You need to target the window from the form, and you may as well use a normal submit button, forget about onclick, and use the onsubmit of the form to open the new window. This may need some tweaking (like a timeout to give the window time to open before the form actually submits or moving the window open to an onmousedown of the submit button to open the window, also with the idea being to get the window open in time for the actual submission), but we will worry about that if there is a problem. So I would do something like:
Code:
<form action="new.html" target="submission"
onsubmit="window.open('',this.target);return true;" method="post">
Your Form Contents Here
<input type="submit" value="Submit">
</form>
new.html should be the name of the page you are posting to.
Added Later:
But this can be done without javascript:
Code:
<body>
<form action="new.html" target="_blank" method="post">
Your Form Contents Here
<input type="submit" value="Submit">
</form>
Bookmarks