Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reset select box value

Status
Not open for further replies.

dude333

Programmer
Feb 5, 2004
11
GB
Hey, Can anyone tell me how to reset a select box to its' default value.

I have this at the moment:

var selForm = document.insert;
selForm.at.options[selForm.at.selectedIndex].value= 0;

html:

<select name='at'>
<option value=0>Choose
<option value=1>One
<option value=2>Two
<option value=3>Three
<option value=4>Four
<option value=5>Five
<option value=6>Six
</select>

Thanks.
 
Thanks for that, spot on. The link looks good too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top