PDA

View Full Version : Passing a variable through when opening a Pop-Up page.


Robart@sph
07-19-2002, 04:03 PM
I have the JavaScript to perform the Pop-Up page which works fine, however I need to pass a variable through from the main page to this Pop-Up so that I can carryout a search of a database, and display the results in the Pop-Up window.

Can anybody advice how I may go about this.

Thanking You in Advance.

RadarBob
07-19-2002, 04:13 PM
you should be able to reference the variable directly - assuming it's an object...

In the child page reference it like this: window.opener.theformname.thevariablename.value (assuming it's a textbox).

tamienne
07-19-2002, 07:46 PM
when you opened the window there's a url field...

window.open(url,windowname,windowproperties)

you can add onto the url the variable that gets passed back to the server.

http://yourdomain.com/search.cgi?searchfor=xyz


window.open('http://yourdomain.com/search.cgi?searchfor=xyz',windowname,windowproperties)

Robart@sph
07-22-2002, 09:03 AM
Thanks Radarbob & Tamienne for you help, problem solved.