View Full Version : Pass query variable from child to parent window

04-27-2006, 07:39 PM
I have an "Add Events" parent window -- a form with many fields. One of the fields is a drop-down list for Event Location. Next to the list is a button for "Add Location." This opens a child window which allows for a new location to be added to the list. Once it's added, a Return button sends the user back to the Add Events parent window.

All of this works great -- the child window closes, and the parent window refreshes with the new location added to the list.

But I'd like to put a finishing touch on it -- if the person has added a new location, logically that location should be selected in the Add Events form when the person returns to it.

My "Add Location" child window includes a query that gets the Id and Name of the location the person added. But

(a) how do I pass that information to the parent window?
(b) how do I use that information to change my drop-down list so the new location is highlighted?

The closing of the child window and return to the parent window is done with a piece of javascript:

function win(){

How do I specify the select list and the new item to be selected?

I am very new to javascript, so will greatly appreciate help targeted to a "layperson"! thanks. --diane