AJAX Autocomplete Example - Better Autocomplete
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.
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.
AJAX Autocomplete Examples to be read along with AJAX Autocomplete Tutorial