Click to See Complete Forum and Search --> : IFRAME hell


Bertrick
03-28-2003, 04:01 AM
Hi I have a problem with IFRAMES and I think this is a perfect testcase for advanced javascript people to tackle.

My goal is to ge access to form elements of an html page that is the source of an IFRAME. For example:

page: master.html (has two Iframes in it)

<TABLE id="SubView" class="formulier" border="0">
<TR></TR>
<TD><IFRAME src="content1.html" id="SubViewFrame"
name="SubViewFrame"
</IFRAME>
</TD></TR>
<IFRAME src="content2.html" id="SubViewFrame"
name="SubViewFrame"
</IFRAME>
</TABLE>

Now i'd like to get access from Iframe:content2.html to the src content1.html.

In content 1.html there is an form named form1 and a textfield called hit.

I d like to read the value of content1.html (Iframe name:SubviewFrame) form1 --> textfield (name:hit). And I'd like to know how to get to that value from Iframe content2.html. Is that possible ? Please help meI tried a lot. Microsoft says:

document.frames("IFrame1").document.all and then it stops)

gil davis
03-28-2003, 05:39 AM
Part of your porblem lies in the fact that an ID has to be unique. You cannot give both iframes the same ID. Once you fix that, you should use document.getElementById() for the iframe you want to access.