I don’t know exactly how to do this, but ....
if you look at this answer: jQueryUI: how can I configure the parameters of the Autocomplete plug-in?
you can see how you can script using jQuery render logic to change how the menu items are displayed. There is also an internal jQuery function called renderMenu that actually represents the options.
I have not tried this, but I believe that by opening this black box and replacing or renaming renderMenu and its related functions, you can do what you want - to display only one element in the actual text box.
That's where I start, anyway.
EDIT
I again looked at the autocomplete stuff in the jQuery user interface. It seems like a pretty simple replacement for the menu display logic by inserting a custom response() function.
Here is what I did:
// display the first item in the list of possible completions var myResponse = function( items ) { var itemToSuggest, p1, p2; if (items.length === 0) {return;} itemToSuggest = items[0]; this.element.val( itemToSuggest ); p1 = this.term.length; p2 = itemToSuggest.length; setSelectionRange(this.element[0], p1, p2); }; var oldFn = $.ui.autocomplete.prototype._response; $.ui.autocomplete.prototype._response = myResponse;
Working example
source share