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

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

irt.org | Knowledge Base | JavaScript | Form 3.4 | Q418 [ previous next ]

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

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


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.