How to open a new window OnSubmit
| 9:36 am on Jan 18, 2004 (gmt 0)|
I'm trying to create a form that will open a new browser window when the user clicks submit, simultaneously passing the values from the form to the new window, and the new window has no toolbar or address bar. I don't want to send the values (variables) from the form to the new window using the address (ex. default.html?Username=blah). Anyone knows how to tackle this?
| 1:09 pm on Jan 18, 2004 (gmt 0)|
Common window options are:
width=(in pixels, e.g. 350)
<a href="" OnClick="window.close()">Close Window</a>
| 8:41 pm on Jan 26, 2004 (gmt 0)|
I tried adding enctype="application/x-www-form-urlencoded" to the <FORM> tag but it made no difference on Netscape.
The code submitted in the previous post by thehittmann is perfectly fine for hyperlinks but will not pass in form variables to the new window unfortunately.
You need to submit your form using POST instead of GET and the URL of the new window being opened will need to be a JSP, ASP, PHP or PL script that will read the variables and do whatever you want with them. Using GET instead of POST will display the variables in the URL-bar as you suggested which is not very nice at all so use method="post" in your form being submitted.
Hope this helps,
[edited by: tedster at 8:09 pm (utc) on Jan. 27, 2004]
[edit reason] remove sig file [/edit]
| 1:30 pm on Jan 27, 2004 (gmt 0)|
<FORM method=POST action="[URL]" target="_top">
Not sure if it works in all browsers, though...
| 7:02 pm on Jan 29, 2004 (gmt 0)|
Sorry, I meant:
<FORM method=POST action="[URL]" target="_blank">