IFrame and Firefox

S

Steven

I am having problems with IFrames and Firefox.

To make things simple I have index.html and frame.html:

------------ index.html -----------------
<html>
<head>
<title></title>
<script language="javascript" type="text/javascript">
<!-- Hide from Non-Javascript browsers
function getTextBoxValue()
{
responce =
document.frames["myFrame"].document.getElementById("myTextBox").value;
alert(responce);
}
function getIFrameSRC()
{
responce = document.frames["myFrame"].src;
alert(responce);
}

// Stop Hiding -->
</script>
</head>
<body>

<h1>Here is the IFrame</h1>

<iframe id="myFrame" name="myFrame" src="./frame.html"></iframe>

<br /><br />

<input type="button" onClick="getTextBoxValue();" value="Get Text Box
Value" />
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" onClick="getIFrameSRC();" value="Get IFrame SRC"
/>

</body>
</html>


------------ frame.html -----------------
<html>
<head>
<title></title>
</head>
<body>
Hello, I am in your frame...
<br /><br />
<input type="text" name="myTextBox" />
</body>
</html>


My problem is anytime I try to reference the IFrame and beyond, I get
the following error:

Error: document.frames has no properties

This works fine in IE.

How can I reference the IFrame and its contents in Firefox?

Thanks in advance...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
DewittMill
Top