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!

getting info from a popup window

Status
Not open for further replies.

mark1110

Programmer
Joined
Apr 20, 2005
Messages
85
Location
US
I am using the windows.open function to pop up a window that I wrote using HTML. I have the name, address, city, state, zip text field along with a radio button and list menu. How can I pass the information from this pop up window back to the original htlm page?

For example:

window.open("customerInfo.html",abc);
// need to get the info back from the html code and use it here.

Thanks,

Mark
 

You would use the opener property of the window object. So from the popup:

Code:
window.opener.document.forms['myForm'].elements['someElement'].value = 'abc';

If there were a form called "myForm" with an element called "someElement" in the main window, that would set its value.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Or if you have a global variable in the opening window you can use:
Code:
window.opener.[i]varname[/i] = 'abc';


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top