Iframe question

HiThis is on web

I have a iframe on the Main form (A) and iframe has link to $$viewtemplate form and that form has a button called Add

when i click on Add, it opens a child form and when user saves it i have to set a radio button valued on Mainform(A)

Please help me, i’m struggling to resolve this from couple of days

Subject: iframe question

Child form will have the iframe - I guess - as parent.If this is true. you can use iframe stuff (elements and events) using document.opener element.

In the same sense, iframe has a document.opener element which is your main form (A).

You should test grabbing field data - for instance - using document.opener element.

When you can display data from the child form from the iframe or from the main form (A), just adapt your code to set the radio button as you wish.

Subject: RE: iframe question

i’m not getting the handle of the opener form, when i write window.opener it consider the form in iframe as the opener and not the main formalert(window.parent.document.getElementById(“crmForm”));

stillnot working

Subject: RE: iframe question

ok. You have this (in order):Main form <—> Iframe <----> child form

From inside child form: window.opener = Iframe

From Iframe: window.parent = Main form

So, in the child form you can access Main form, using:

window.opener.parent

Subject: RE: iframe question

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/fea7a04c1f7270c685257046000fbdb0?OpenDocument&Highlight=0,iframe,parent

my problem is something like this

i tried what you mentioned in your response, but it didn’t work

thanks for looking into this

Subject: RE: iframe question

This code is awful. There is no need of an agent that prints a javascript…Unless you need to do something else in the agent, I would completely do this in another way.

The button would have a simple javascript:

var url = ‘/database.nsf/ChildForm?OpenForm’;

window.open(url,‘Title’, ‘menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes, copyhistory=no,width=375,height=375,left=375,top=5’);

And… this code:

unction copyToOpener() {

for ( i = 1; i < document.forms[0].elements.length; i++) {

var fieldName = document.forms[0].elements[i].name;

if (fieldName != null && fieldName != ‘’) {

opener.parent.frames[“agentFrame”].document.forms[1].elements[fieldName].value=document.forms[0].elements[i].value;

}

}

window.close();

}

sets fields in the iframe not in main form.

Forget about the iframe and the agent…

Describe what you need that I am positive it can be done in a blink.