Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | JavaScript | Form 10.3 | Q33 [ previous next ]

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

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


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.