Hi, I have some problem making a pop up customized from a form...I didn't have problem to make the pop up, but had some trying to customize it, cause I want it with no toolbar, no location ,no directories, no status,no menubar,no scrollbars,no resizable and width=770,height=600 . I am using an "action" button.

So, I'll copy the HEAD code and the FORM code for you to see....and hope something comes out....

Thanks Very Much!!!

HEAD code

<script>
<!--
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
else {if (lowtarget=="_blank") {window.open(loc);}
else {if (lowtarget=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf("*");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
//-->
</script>

FORM code

<form action="dummy" method="post"><select name="choice" size="1">
      <option value="">Choose a city...</option>
      <option value="cities/madrid.html*_blank">Madrid</option>
      <option value="cities/amsterdam.html*_blank">Amsterdam</option>
    </select><input TYPE="button" VALUE="GO!" onClick="jump(this.form)"></form>

Dani AI

Generated

Short version: you can open a named popup and submit the form into it, but modern browsers treat the window-feature flags as advisory and will often ignore attempts to strip browser chrome. , the practical pattern is to call window.open() with a features string, set the form target to the popup name, then submit. That keeps the POST in the new window and lets you request width=770,height=600 and toolbar=no,location=no,menubar=no,.... is right to call out the UX and security concerns: do not try to trap users, and expect browsers to protect them.

Example pattern (adjust names/URL to your page):

function submitToPopup(form, url) {
  var features = 'width=770,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,noopener';
  var popup = window.open('', 'cityPopup', features);
  if (popup) {
    form.action = url;
    form.target = 'cityPopup';
    form.submit();
    popup.focus();
  } else {
    // popup blocked: fall back to same-tab navigation or target _blank
    window.location.href = url;
  }
}

Notes and practical tips:

  • Browsers may ignore many feature flags (especially on mobile). The features string is only a request; see the browser behavior notes on MDN for details: Window.open on MDN.
  • Avoid security issues from window.opener. Use the noopener flag or clear popup.opener, and for anchor links use rel="noopener noreferrer".
  • If content is same-origin and you need full control over the appearance and controls, prefer an in-page modal or the native <dialog> element for accessibility and consistent behavior: HTML dialog element on MDN.
  • Always include a graceful fallback (open in same tab or plain _blank) if the popup is blocked or features are ignored, and provide clear close/navigation options so users are never trapped.

This balances the technical solution you want with real-world browser behavior and the user-safety concerns raised by .

Recommended Answers

All 3 Replies

Those things belong to the user, not to you. You should not have any right to make a window without any controls.

Those things belong to the user, not to you. You should not have any right to make a window without any controls.

Sorry, but.....I have the right indeed....it's my website... If it where like you say, I would hve to let the visitors to change every aspect of my website...everything.

Suggestion, do not reply posts If you're not helping...that's the idea of the forum...

Sorry, but.....I have the right indeed....it's my website... If it where like you say, I would hve to let the visitors to change every aspect of my website...everything.

Suggestion, do not reply posts If you're not helping...that's the idea of the forum...

You do NOT have that right. You are effectively saying that the user can't leave your website, by taking away his controls. This is committing a wrong against the user by taking control away from him and taking over his computer.

I am totally SICK of web page designers who design pages the user can't leave without using the task manager. It should be illegal, with jail time. I have seen this trick used on eBay too often. They fix it so you can't do any comparison shopping once you get to the page. You have to bid to leave it.

It is pure selfishness.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.