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

Q312 What is the simplest script for selecting an option from a drop down list and loading the page into another frame without a button?

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

<FORM NAME="myForm">
<SELECT NAME="mySelect" onChange="parent.FRAMENAME.location.href=document.myForm.mySelect.options[document.myForm.mySelect.selectedIndex].value">
<OPTION VALUE="http://www.yahoo.com">Yahoo
</SELECT>
</FORM>

In older browsers it requires that the user chooses a selection and then click elsewhere to trigger the onChange event handler.

©2018 Martin Webb