...

View Full Version : Creating a popup and posting to the new window



Sebbe
01-30-2006, 08:03 AM
Hi I wonder if it's technicaly possible to achive the following behavior using Javascript. Imagine a form using post. When you hit the submit of this form a popup is created which all the data gets posted to.

Thankful for any replies!

glenngv
01-30-2006, 10:00 AM
HTML:

<form action="blah.asp" method="post" target="mypopup" onsubmit="openPopup(this.target)">
...
<input type="submit" value="Submit" name="btnSubmit" />
</form>
Javascript:

function openPopup(target){
var w = window.open('', target, 'width=600, height=500, resizable=1');
w.focus();
}
If you want a normal popup window with address and menu bar visible and no pre-set size and location, then you just specify target="_blank" in the form tag and no scripting needed.

Sebbe
02-06-2006, 09:12 AM
Forgot my login info so couldn't thank you right away.

Thanks for the help, worked perfectly.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum