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!

Submit input from a pop-up

Status
Not open for further replies.

NateBro

Programmer
Joined
Sep 1, 2004
Messages
233
Location
US
I have an order form and i would like to open a pop-up window and have some options in it, and have it submit to the main window.

but i do not want to actually SUBMIT the input, jut have the two windows working with each other, mainly running a function, that transfers the input from the pop-up to the main page.

the opposite of something like this.....

<script>

var popup = window.open('','','')

popup.document.write('')

</script>
 

To get a popup to talk to the window that opened it, you can use the "opener" property. For example, if your main window had a form called 'myForm', with a text input called 'myInput', you could set its value from within the popup like this:

Code:
window.opener.document.forms['myForm'].elements['myInput'].value = 'some value';

Hope this helps,
Dan

 
Yes it does! thank you soooooooo much! :)
 
Hey there. I was hoping someone can give me the example of how this will actually work. I mean the entire script in action. Help, please.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top