Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Posting a form to an 'opener' window

Status
Not open for further replies.

XgrinderX

Programmer
Mar 27, 2001
225
US
I have a pop up window that has several buttons on it. One of the buttons needs to submit a form with hidden inputs and have the action of the form be directed to the original window (the window that spawned the pop up). Then the pop up window will close.

I know how to do this by putting the hidden form values in the querystring, BUT I do not want to pass the data that way. I want to pass them using the post method as hidden inputs.

Anyone have any ideas on this?

-Greg
 
Try this:
<form action=&quot;page.php&quot; method=&quot;post&quot; name=&quot;the_form&quot;>
<input type=&quot;hidden&quot; name=&quot;the_name&quot; value=&quot;the_value&quot;>
<input type=&quot;button&quot; onClick=&quot;document.the_form.target=window.opener.location.href;document.the_form.submit();&quot; value=&quot;Submit to opener&quot;>
<input type=&quot;submit&quot; value=&quot;Normal Submit&quot;>
</form>

Rick -----------------------------------------------------------
 
Hmmm...that looked promising, but for me all it did was open the action page in ANOTHER window, which is what all my previous efforts have done as well.

Any other ideas?
 
I found an answer! I got it from
Here is the solution:

In the past I have created a hidden form in the opener & stuffed the data into this from the pop-up when the pop-up form is submitted, then submitted the opener form, e.g.:

<input type button value='Submit' onclick='SubmitOpener();'>

function SubmitOpener(){

window.opener.document.forms[&quot;openerform&quot;].somefield.value=document.forms[&quot;p
opupform&quot;].value;
...
...
window.opener.document.forms[&quot;openerform&quot;].submit();
window.close();
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top