views:

24

answers:

0

I'm using the jquery autocomplete UI widget, for example:

var names = ["John", "Jack", "Nick", "Tom", "Joyce", "Nancy"];
$("#nameInput").autocomplete({
    source: names
});

I'd like it to behave like the Gmail's "To" textbox.

Specifically, I'd like it to highlight the best match as you type and if you press enter, then the highlighted value gets selected.

In other words, I don't want to have to use the up/down arrows or the mouse to make the selection.

Thanks for any suggestions!