Forum Moderators: open

Message Too Old, No Replies

Using Javascript to change <input> option

         

joshenry

3:56 pm on Jul 7, 2008 (gmt 0)

10+ Year Member


Is there any way to use a javascript (or other device) to physically change the selected option and subsequent value of a (select tag) pull-down menu?

What I'm trying to do is reset the selection and value of the input option without resetting the whole form.

eelixduppy

4:00 pm on Jul 7, 2008 (gmt 0)



Just change the selected index:

document.getElementById('select_input').selectedIndex = 0;

joshenry

5:05 pm on Jul 7, 2008 (gmt 0)

10+ Year Member



eelixduppy,

Thanx much!

I can't believe it was that simple. :)