I'm trying to set the src for an IFrame in javascript, but keep getting the error 'document.form1.Fram1' is null or not an object.
The following code is being used. It works fine for Img tags and images, but blows up when I try to access the IFrame. What am I missing?
Any suggestions would be greatly appreciated.
TT
<HEAD>
<Script Language="javascript">
function DoText(){document.form1.Fram1.src="Text/Pig.htm";}
</Script>
</HEAD>
<BODY onLoad="DoText()">
<Form Name="form1" ID="frm1">
<IFrame Name="Fram1" ID="Fram1"></IFrame>
</Form>
</BODY>
The following code is being used. It works fine for Img tags and images, but blows up when I try to access the IFrame. What am I missing?
Any suggestions would be greatly appreciated.
TT
<HEAD>
<Script Language="javascript">
function DoText(){document.form1.Fram1.src="Text/Pig.htm";}
</Script>
</HEAD>
<BODY onLoad="DoText()">
<Form Name="form1" ID="frm1">
<IFrame Name="Fram1" ID="Fram1"></IFrame>
</Form>
</BODY>