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

Q418 When using a drop down menu, how do I store the value selected in a variable?

You are here: irt.org | FAQ | JavaScript | Form | 3.4 | Q418 [ previous next ]

Try:

<script language="JavaScript"><!--
var result = null;
//--></script>

<form>
<select onChange="result = this[this.selectedIndex].value">
<option VALUE="1">One
<option VALUE="2">Two
</select>
</form>

Feedback on 'Q418 When using a drop down menu, how do I store the value selected in a variable?'

©2018 Martin Webb