|
Q3 How do you change the URL of a frame by typing in the URL in a text box of a different frame?
irt.org | Knowledge Base | JavaScript | Frame | Q3 [ previous next ]
Q3 How do you change the URL of a frame by typing in the URL in a text box of a different frame?
If your initial file contains:
<html>
<frameset rows="50%,50%">
<frame src="frame1.html" name="frameName1">
<frame src="frame2.html" name="frameName2">
</frameset>
</html>
|
In frame1.html place the following contents:
<html>
<script language="JavaScript"><!--
function functionName() {
parent.frameName2.location.href =
window.document.formName.textName.value;
return false;
}
//--></script>
<form name="formName" onSubmit="return functionName()">
URL: <input type="text" name="textName" value="">
<input type="submit" value="Go" onClick="return functionName()">
</form>
</html>
|
In frame2.html, just to ensure you don't get any errors place the following:
<html>
<body>
</body>
</html>
|
Feedback on 'Q3 How do you change the URL of a frame by typing in the URL in a text box of a different frame?'
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.