Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need quick help with calling function() from nested iframe

Status
Not open for further replies.

JulieB4

Programmer
Joined
Apr 20, 2006
Messages
2
Location
US
Here is what I have:

<frameset id=body rows="50%,50%,*">
<frame name=data1 src="./launch.htm">
<frame name=data2" src="./run.php">
<frame name=data3" src="./blank.htm">
</frameset>

The data2 frame has a nested <IFRAME> named "controller". That IFRAME has a form with a focus() call to place the cursor in the starting form position.

I don't know how to parse out focus() to work because of this complex iframe scenario. I've tried many things like parent.frames[0].frames['data2'].frames['controller']. document.forms['formname'].elements['fieldname'].focus(); ... sadly won't work for me.

Can anyone see this more clearly? I would so much appreciate your expertise and time, so much

%Julie%
 
The absolute path for referencing the element "fieldname" is this.

[tt] top.frames['data2'].frames['controller'].document.forms['formname'].elements['fieldname'].focus(); [/tt]

Equally good, like it or not.

[tt] top.data2.controller.document.formname.fieldname.focus(); [/tt]

 
One more associated question -- how would I call a function() that is located inside controller from the data1 frame?
 
Same. If it has no parameters,...
[tt] top.frames['data2'].frames['controller'].myfunction();[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top