[Javascript] Passing Selection Data

Peter Brunone peter at brunone.com
Fri Sep 27 12:22:06 CDT 2002


Greg,

    I guess you answered your first question already :)

    From the child window, you can refer to the parent window as
window.opener and from there, everything is pretty much accessible.  For
example, if the main window has a form named "mainForm" with a text input
named "cityName", you could change cityName to whatever you want with the
following line of script:

window.opener.document.forms.mainForm.cityName.value = "Dallas";

    Just about all the objects in the main page can be accessed through the
opener object.  For older browsers you may have to explicity set the opener
property when you open the window, i.e.

var newWin = window.open("whatever, etc.".....)
newWin.opener = window;

but most modern browsers (IE and NN 4.0 and up) take care of that so you
don't have to worry about it.  Let me know if any of this is confusing...

Cheers,

Peter

----- Original Message -----
From: <greg at krieser.com>


| Is it possible to pass selections from a pop-up window to a main page with
JavaScript?  On the following page
|
|
http://www.cbshome.com/IRP/listing/ListingSearch.asp?ListingType=1&SearchTyp
e=Geographic
|
| a map link provides a pop-up window with a map.  When you click on
sections of the map, the information of the selection is passed back to the
main page.  How is this done?  I've got a file with a map that fills in form
data when a selection is made, but it is all on one page.  I like the pop-up
idea.  Can't seem to understand how they did it?
|
| Anyone have experience with this?
|
| Thanks,
|
| Greg





More information about the Javascript mailing list