When I use onKeyPress event handler for my select box, it gives me weird behaviour, e.g if i choose #72 item, it actually gives me next item #73, if i choose #73, it gives me #74. I am not sure why. here is the snippet of my code: <select id="children_of_category_[% Pid %]" onClick="getSub(this.id)" onKeyPress="getSub(this.id)"> Code (markup): Thanks in advance
Does it always occur in that order? It sounds like you are a 'click behind' which may be what occurs with OnKeyPress Try using onkeydown or onkeyup instead. onkeyup might have more luck.