I have a parent window with javascript and a child popup window with a form
in it. I need to pass the information inputed in the form located on the
child window to variables in the parent window javascript. I have tried
using opener but that only appears to pass input from a child window to a
parent window into form controls and not specific variables in a javascript
function. Can someone suggest how to solve this issue?
Thank you in advance,
Sam
Anoop CM - 10 Jul 2005 12:13 GMT
write a function in the parent page which has the arguements u want to
recieve.
and set the variables inside the function You can then call this function
from
the child window using opener.functionname
HTH
Anoop
> I have a parent window with javascript and a child popup window with a form
> in it. I need to pass the information inputed in the form located on the
[quoted text clipped - 6 lines]
>
> Sam
Serge Baltic - 12 Jul 2005 16:33 GMT
SS> I have a parent window with javascript and a child popup window with
SS> a form in it. I need to pass the information inputed in the form
SS> located on the child window to variables in the parent window
SS> javascript. I have tried using opener but that only appears to pass
SS> input from a child window to a parent window into form controls and
SS> not specific variables in a javascript function.
The variables in a javascript functions are indeed LOCAL variables of that
function, and exist only while the function is being executed. Moreover,
a new set of variables is created each time it happens. Thus there's practically
no use of assigning them a permanent value.
However, if you declare some global variables in the parent window's javascript
— in the form:
var myvariable;
— they will be global and exist thru the page's life span. They may be accessed
as properties of the parent page's "window" object.
(H) Serge