...

View Full Version : referencing a form in a frame from another frame



flurbius
04-14-2005, 02:16 PM
I have to reference a control (name="datefrom") from a form (dateform) in a frame (reportcontrols). the code that does it is in another frame in teh same frameset (which is contained in an iframe).

the code i use to do this is:

parent.reportcontrols.dateform.datefrom.value

which works in ie but not in ff,

what is the equiv in ff and will that work in ie ?

TIA

flurbius
04-14-2005, 02:40 PM
well i figured it out:

this did the trick in both browsers:

parent.reportcontrols.document.dateform.datefrom.value

Kor
04-14-2005, 04:14 PM
try using most of the time the full squared reference. It will help you avoid errors if you have names such as "name_01" or :"name%02_01" or you might need change dynamically something. And don't forget to specify document as root in case of a document's element. IE will accept without this specification, but this is corrupt way of referencing, thus no other browser will take it, i am affraid.

parent.frames['reportcontrols'].document.forms['dateform'].elements['datefrom'].value
or
top.frames['reportcontrols'].document.forms['dateform'].elements['datefrom'].value



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum