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

Q621 How can I have a dropdown form redirect to other pages, without a submit button?

You are here: irt.org | FAQ | JavaScript | Form | 8 | Q621 [ previous next ]

Try:

<SCRIPT LANGUAGE="JavaScript"><!--
function goto_URL(object) {
    window.location.href = object.options[object.selectedIndex].value;
}
//--></SCRIPT>

<FORM>
<SELECT NAME="selectName" onChange="goto_URL(this.form.selectName)">
<OPTION VALUE="apage.htm">A page
<OPTION VALUE="bpage.htm">Another page
</SELECT>
</FORM>

Feedback on 'Q621 How can I have a dropdown form redirect to other pages, without a submit button?'

©2018 Martin Webb