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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

child window submits a form in parent window

Status
Not open for further replies.

richardko

Programmer
Joined
Jun 20, 2006
Messages
127
Location
US
Hi,
I need to submit a form in parent window through a child window. I have a fair idea of how this is done except - i have three buttons in my parent window that can submit the same form. When submitted I check which button was pressed and perform various functions accordingly. When I am submitting the form in parent through child is it possible to specify how the form should be processed. example.
<parent window>
<form name="test" action="SELF" method="POST">
<input type="submit" name="exchange" value="exchange">
<input type="submit" name="replace" value="replace">
<input type="button" name="original" onClick="openChildWindow()">
</form>
</parent window>

<child window>
<input type="text" name="send_to_parent">
<input type="submit" name="child_submit" onClick="sendtoparent()">
</child window>

In the "child window" I want to submit the form in the parent window as if the "original" button was pressed. Is this possible?
thanks
 
well in this case you'd just want to call the openChildWindow() function? then you can just do this in your child window:

Code:
<input type="[red]button[/red]" name="child_submit" onClick="[red]opener.openChildWindow()[/red]">



*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
I tried calling "opener.openChildWindow()" from the child window but it doesnt work. Looks like a recursive function isnt though - because the openChildWindow() is called from the parent too.
if I execute a function like this in a child window:

opener.document.test.submit()

is it possible to specify the button like this:

opener.document.test.submit("original") ? Or could I call a function in the parent window that can execute this?
thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top