tags:

views:

56

answers:

1

How to pass value from parent to child window field. I use window.open("www.google.com");

after popwindow is opened i need to pass/set search value typed in parent window to child window(www.google.com)

A: 

Set a reference using the window.open() method:

var childWin = window.open("www.google.com" <etc.>);

Then treat childWin as a whole other window. For example,

childWin.document.getElementById('searchField')

will give you a reference to an element with ID of "searchField". Etc. Rinse and repeat.

Robusto
Note that you can also access variables defined in the newly opened window as well.var childwin = window.open('....');childwin.variable = 'somevalue';If the variable was predefined, it will contain the new value, if it was not defined, it will now contain the value you set.
CDSO1