Submit a form to a new popup window
Today I needed to create a new chromeless (no scrollbars, toolbarrs, navbars etc)
window and submit a form to it because we were directing users to another vendor’s
product who required information to be submitted via POST to their site to proceed.
Here is how I proceeded.
PROBLEM: How to submit a form to a new popup window.
SOLUTION: I modified the <form> target and onsubmit properties.
Non-JavaScript users will get a regular new window which works fine for our
application because at least they are not taken away from the site.
CODE:
<form name=”frmModule5″ id=”frmModule5″ action=”processingPage.jsp”
method=”post” target=”moduleFive” onsubmit=”window.open(’about:blank’,
‘moduleFive’, ‘width=800,height=550,resizable=true,scrollbars=true’);”>…. form elements here …
<input type=”submit” value=”submit”>
</form>