Referring to a Field on a Parent Window

On a $$ViewTemplate, I have an iframe which opens a child window. A button on the child window can get a handle on the iframe with the following code:

alert(opener.parent.frames[“frameName”].name);

My question is this - how might this button refer to a field on the $$ViewTemplate that’s not in the iframe?

I’ve already tried the following, plus several variations of these without success:

alert(opener.parent.frames[“frameName”].document.forms[0].FieldName.value);

alert(opener.parent.parent.frames[“frameName”].document.forms[0].FieldName.value);

alert(window.parent.document.forms[0].FieldName.value);

alert(window.top.document.forms[0].FieldName.value);

I’d appreciate any ideas on this. Thanks.

Subject: Referring to a Field on a Parent Window

Hi,

I Hope I understand it correctly, but try:

window.opener.parent.parent.document.forms[0].FieldName.value;

window.opener.parent refers to the iFrame, window.opener.parent to its parent: the view template.

Good luck,

Mark

Subject: RE: Referring to a Field on a Parent Window

Here’s the solution I was looking for:

opener.parent.parent.frames[“FrameName”].document.forms[0].FieldName.value

I was referring to the wrong frame name.

Thanks.

Subject: RE: Referring to a Field on a Parent Window

This works too…

Print |alert(eval(“parent.document.forms[0].FieldName.value”))|