Forum Moderators: open

Message Too Old, No Replies

popup window on submit

how to POST form contents into a popup window?

         

phph

8:46 pm on Feb 28, 2006 (gmt 0)

10+ Year Member



I want to open the form's target script (action="") into a popup window for confirmation of entered data and then have another button in the popup window which would actually post the data to another script that would open in the originating window (and possibly close the popup automatically, as it is no longer needed).

Any help is greatly appreciated!

Trace

9:38 pm on Mar 1, 2006 (gmt 0)

10+ Year Member



I would do it like this...

Your original page contains this:

<form action="http://www.google.com" method="post" name="frmForm">
<input type="text" name="txtField">
<input type="button" onClick="window.open('test2.html');">
</form>

Your popup window would have this:

<script language="JavaScript">
document.write(window.opener.document.frmForm.txtField.value);
</script>
<form>
<input type="button" onClick="window.opener.document.frmForm.submit();">
</form>

Didn't try it, but it should work.
Hope it helps.

phph

12:50 am on Mar 3, 2006 (gmt 0)

10+ Year Member



That worked fine, thanks!