OnSelect Not Working

I'm attempting to populate an input box via an OnSelect from a list box (see below), but it doesn't work, for some reason.  Any suggestions?

<html><head><title>OnSelect Test</title></head>
<form name=dt_form method=post>
<p><select name=date>
<option value=0>Choose a Date
<option onSelect="document.dt_form.dt.value = '01/14/2000'" value=today>Today
<option onSelect="document.dt_form.dt.value = '01/13/2000'" value=yesterday>Yesterday
</select></p>
<p><input type=text size=10 maxlength=10 name=dt value=""></P>
</form>
</html>
aricheeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
knightEknightConnect With a Mentor Commented:
You need to do this:

<SELECT name='date' onChange='this.form.dt.value=this.options[this.selectedIndex].value;'>
 <OPTION value='0'>Choose a Date</option>
 <OPTION value='01/14/2000'>Today</option>
 <OPTION value='01/13/2000'>Yesterday</option>
</select>

_____________________________________________________________________________________________
0
 
aricheeAuthor Commented:
Edited text of question.
0
 
deepchandaCommented:
onSelect is not an eventhandler for select drop-downs, u will have to use onChange instead

DC
0
All Courses

From novice to tech pro — start learning today.