Forum Moderators: open

Message Too Old, No Replies

Execute on select change

         

andrewsmd

2:27 pm on Mar 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need to run a js function every time a dropdown changes. If I use on change, then you have to click out of the dropdown to execute the function. Is there any way I can get this to execute every time the dropdown changes. What I mean is, if you were clicked in the select box and you push the down arrow to change it, it executes again. Thanks,

Demaestro

2:56 pm on Mar 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



try onBlur

Fotiman

5:06 pm on Mar 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



[w3.org...]
The SELECT element supports:
onfocus
onblur
onchange

The other intrinsic events are:
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

You might be able to attach a listener to the onclick, onmouseup, onkeyup, and onchange event (though might cause your event listener to fire more than once).

andrewsmd

7:06 pm on Apr 1, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I ended up using the on change. I just had to hit enter on my keyboard. Thanks,