I have the following frameset:
[code=html]<html>
<head>
</head>
<frameset cols=”50%,*”>
<frame name=”frame1″ src=”frame1.htm”>
<frame name=”frame2″ src=”frame2.htm”>
</frameset>
</html>
The frame1.htm page looks like this:
[code=html]<html>
<head>
</head>
<body>
<h4>Frame 1</h4>
<form name=”form1″>
<input type=”text” name=”text1″ value=”value1″ />
</form>
<script language=”JavaScript” type=”text/javascript”>
var txtBoxValue2=window.parent.frame2.document.form2.text2.value;
document.write(“The value in the text box in Frame 2 is: “+txtBoxValue2);
</script>
</body>
</html>
frame2.htm looks like this:
[code=html]<html>
<head>
</head>
<body>
<h4>Frame 2</h4>
<form name=”form2″>
<input type=”text” name=”text2″ value=”value2″/>
</form>
<script language=”JavaScript” type=”text/javascript”>
var txtBoxValue1=window.parent.frame1.document.form1.text1.value;
document.write(“The value in the text box in Frame 1 is: “+txtBoxValue1);
</script>
</body>
</html>
Why is it that this code only works to access the value in form 1, frame 1 [I]from [I]from