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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

aricheeAuthor Commented:
Edited text of question.
0
knightEknightCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
deepchandaCommented:
onSelect is not an eventhandler for select drop-downs, u will have to use onChange instead

DC
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.