![]() |
|
|
+ Search |
![]()
|
Apr 5th, 2008 20:21
ha mo, Darton Williams, Jiga What,
Just name the frames like so:
<FRAMESET rows="100,*">
<FRAME src="test2.html" name="topFrame">
<FRAME src="test3.html" name="bottomFrame">
</FRAMESET>
and you'll be able to access anything (including constants) between
frames with syntax like:
parent.topFrame.document.myForm.textField.value...
The parent object is actually the base HTML doc where the frameset is
defined, so you're stepping up one level in the DOM and back down to
the source in the other frame.
So we could have something like this in test2.html:
<BODY>
<FORM name="topFrameForm">
<input type="text" name="text1" value="Testing">
</FORM>
</BODY>
and something like this in test3.html:
<HEAD>
<SCRIPT language="JavaScript">
function getTopValue()
{
alert(parent.topFrame.document.topFrameForm.text1.value);
}
</SCRIPT>
</HEAD>
<BODY>
<FORM name="bottomFrameForm">
<input type="button" value="Get Top Value" onClick="getTopValue()">
</FORM>
</BODY>
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com