AJAX Autocomplete Example - Better Autocomplete


Selected option number : 0
AutoComplete Text Box:
Now we are talking mostly in Javascript.

All key have Events attached to and "arrowdown" and "arrowup" key highlights the options.
Enter key pressed after the selection fills the text box with highlighted options.

AJAX results have additional "onmouseover" event attached to the options, resetting the highlighted option chosen by keys.

"onkeypress" was not returning the keycode of the "arrow" key, so changed from "onkeypress" to "onkeyup" event. Since we changed to "keyup" now we also need to verify that the key pressed is a character key only.



SHARE Whatsapp Facebook Twitter To TOP