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

Q1530 How can a text box show the selected item from a select control, and then the select control be reset to always show " Select an item"?

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

Try:

<form>
<input type="text" value="" name="currentSel">

<select onChange="this.form.currentSel.value=this.options[this.selectedIndex].value;this.selectedIndex=0;" SIZE="1">
<option value="">Select an item</option>
<option value="first">first</option>
<option value="second">second</option>
<option value="third">third</option>
</select>

</form>

©2018 Martin Webb