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

Q33 How do I get a value from a dropdown menu, and use it to change the location of another frame?

You are here: irt.org | FAQ | JavaScript | Form | 10.3 | Q33 [ previous next ]

When the following frameset definition has been used:

<frameset rows="20%,*">
    <frame src="frameA.html" name="frameA">
    <frame src="frameB.html" name="frameB">
</frameset>

Use the following type of drop down menu in frameA:

<form name="drop">
<select name="down">
<option value="http://www.yahoo.com">Yahoo
<option value="http://www.netscape.com">Netscape
<option value="http://www.microsoft.com">Microsoft
</select>
<input name="submitName" type="button" value="Go"
onClick="top.frameB.location.href = this.form.drop.down.options[this.form.drop.down.selectedIndex].value;return false">
</form>

or:

<form name="drop">
<select name="down">
<option value="http://www.yahoo.com">Yahoo
<option value="http://www.netscape.com">Netscape
<option value="http://www.microsoft.com">Microsoft
</select>
<input name="submitName" type="button" value="Go"
onClick="parent.frameB.location.href = this.form.drop.down.options[this.form.drop.down.selectedIndex].value;return false">
</form>

Feedback on 'Q33 How do I get a value from a dropdown menu, and use it to change the location of another frame?'

©2018 Martin Webb