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

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

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

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

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>

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.