jcgroove
Technical User
- Oct 8, 2008
- 4
So what I'm trying to do is change the background color or image of frame_a based on a hidden form id value in frame_b. I haven't been able to get it to work in firefox. Can anyone help me please!
Here is the html for the frameset page:
<html>
<frameset rows="25%,75%">
<frame name="frame_a" src="frame_a.htm">
<frame name="frame_b" src="frame_b.htm">
</frameset>
</html>
Here is the html for frame_a:
<html>
<head>
<script>
function changeBG(){
if (document.all) {
if (frame_b.document.nodeForm.classification_id.value = "C")
document.body.style.background = "/blue.png";
else if (document.nodeForm.classification_id.value = "S")
document.body.style.background = "/red.png";
else
document.body.style.background = "/gray.png";
}
}
</script>
</HEAD>
<BODY onload="changeBG()">
<h3>Frame A</h3>
</body>
</html>
And here is the html for frame_b:
<form name="nodeForm">
<input type=hidden name=title value="MENUBAR CONTROLS - COMMON CONTROLS">
<input type=hidden name=node_id value="1000050703">
<input type=hidden name=class_id value="245">
<input type=hidden name=edit_type_id value="G">
<input type=hidden name=review_id value="P">
<input type=hidden name=classification_id value="S">
</form>
<html>
<body bgcolor="#EBC79E">
<h3>Frame B</h3>
</body>
</html>
Here is the html for the frameset page:
<html>
<frameset rows="25%,75%">
<frame name="frame_a" src="frame_a.htm">
<frame name="frame_b" src="frame_b.htm">
</frameset>
</html>
Here is the html for frame_a:
<html>
<head>
<script>
function changeBG(){
if (document.all) {
if (frame_b.document.nodeForm.classification_id.value = "C")
document.body.style.background = "/blue.png";
else if (document.nodeForm.classification_id.value = "S")
document.body.style.background = "/red.png";
else
document.body.style.background = "/gray.png";
}
}
</script>
</HEAD>
<BODY onload="changeBG()">
<h3>Frame A</h3>
</body>
</html>
And here is the html for frame_b:
<form name="nodeForm">
<input type=hidden name=title value="MENUBAR CONTROLS - COMMON CONTROLS">
<input type=hidden name=node_id value="1000050703">
<input type=hidden name=class_id value="245">
<input type=hidden name=edit_type_id value="G">
<input type=hidden name=review_id value="P">
<input type=hidden name=classification_id value="S">
</form>
<html>
<body bgcolor="#EBC79E">
<h3>Frame B</h3>
</body>
</html>