Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q3 How do you change the URL of a frame by typing in the URL in a text box of a different frame?

You are here: irt.org | FAQ | JavaScript | Frame | Q3 [ previous next ]

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?'

©2018 Martin Webb