onClick in <select>
I know there is no onClick event in <select>. I was wondering if there is a way to do that.
What I have right now, is a text box. When somebody enters some text in this text box, a <SELECT> box is fetched with AJAX (with size=20). When user presses DOWN key in the text box (keyCode=40), it selects the first element of thist <select> box.
It works up until the step above. But, when it selects the first element, <SELECT> box disappears ( that's how it works) because onChange event fires for that <SELECT> box.
What I want is that this <SELECT> box does NOT DISappear UNTIL user presses ENTER (working) OR user CLICKS in this select box.
Is that possible? Is yes, then how?
why dont you use autocomplete fields.
If you dont know what autocomplete is, try googling it out. I think that might solve your problem.
What I do is, I call a page with AJAX which can return the data in any format I need. So, if anyone can help me to modify one of these in a way that these scripts take data from a server-side page then that'd mostly helpful.
I think you've got confused with the lack of an onclick event for the OPTION element in IE (there is one for good browsers). There is an onclick event for SELECT and it works in IE and other browsers.