Click to See Complete Forum and Search --> : window name property


FTPoed
11-03-2003, 02:24 PM
I am trying to get the main browser window to refer to a named popup. this works when the opener is referring to the child window, but any subsequent page browsed to after the opener tells me that the child window name is undefined.

what I am trying to do is build a contest where you have to browse around our site to find the answers. The popup window is you entry form. I want to set it up so that when you browse to a page that contains your answer, it passes a value to a text field in the child window and focus it, but as I have said, only the first window that actually opened the child can refer to it, the others find it 'undefined'.

any workaround?

gil davis
11-03-2003, 09:54 PM
If you named the pop-up when you originally open it, any subsequent page can use window.open() to get a handle to the same window. For example:

var theWin = window.open("", "myPop");

will give you a pointer to a window named "myPop" without changing the page in the window. The only caveat is that if the user has closed the window, then your code opens an empty window called "myPop".

FTPoed
11-04-2003, 04:04 PM
yea, I found out that method would work, but I am needing to populate form fields in the child window from the "new parent", .i.e.:

childwindow.myForm.textfield.value = 'something';

..and that won't work no matter what I do. I decided to just use frames instead.

Thanx for the input though. Happy coding.