How do I pull value from parent doc in javascript

I have a notes form, with a button that has a pop up.(in one case…same code, but no popup (new form in same frame)

How do I take a value from the parent Notes form and use it in the popup as a variable.

on the form…

path_info is a cgi variable used in domino…

If I try and do a simple:

alert ( lastwindow )

… I get a lastwindow is undefined…

so either I’m coding something wrong or the value / object doesn’t exist…(but it does)

Can anyone with notes&JS script experience please respond?

the ideas here is to get the path_info value from the parent doc, so when I click close or submit, I can return back to the calling doc…

The final result I’m shooting for is a 3pane framset (top, side, main) where everything loads and runs in main.

thanks,

Brett

Subject: How do I pull value from parent doc in javascript

if you have the parent window being shown and a new window opened from it - in your case, a popup window - you can use this:

var parentWin = window.opener;

var fieldA =parentWin.getElementbyID(‘fieldA’).value;

Replace strings with appropriate names.

Subject: How do I pull value from parent doc in javascript

Use .value instead of .text. .text refers to a text node belonging to a container element (an element that has both opening and closing tags, like but NOT like ), and is unreliable except when used with the option list of a select element.

Oh, and you may find that some browsers have trouble with window.opener being null. A safe way around that is to check the opener on creation:

var newWin = window.open(parms);

if (newWin.opener == null) {

newWin.opener = window;

}

Subject: RE: How do I pull value from parent doc in javascript

Thanks guys!

Ill try it out…