Randell D. wrote:
Folks,
I have a javascript function which is a popup - It contains a list in
form tags - When the user selects a value in the popup, and clicks
submit, I want the values to be transfered to the parent opening window.
I have managed this when I know the name of the parent window - however
there are two or three different 'parent' forms with different form
names that could reference this popup session meaning my current
solution only works for one, but not the others.
My question therefore is, how, without knowing the parent window name,
can I write a value to a form input tag field.
I'm a newbie - part of me thinks I could pass my window name using the
special 'this' reference - but I'm not quite sure - Can someone help
direct me in the right direction?
Cheers
Randell D.
I got it... I just needed some rough direction because objects and DOM's
and whatever seem to go,for the most part, over my head - However, if
someone else is curious on the solution, here goes...
In my parent window, a new popup window is opened, and named, using
window.open()
In my new (child) window, I found I could reference or change the value
in an INPUT tag in the parent calling window using the following
declaration:
window.opener.document.forms[0].myParentInputTagName.value="whatever";
Thus, using the above bit of javascript - when contained in my child
window would lead my parent form, which would contain an <INPUT
NAME="myParentInputTagName"> to have the value "whatever" assigned to it.
randell d.