Is it possible to disallow free text entry in the JQuery UI autocomplete widget?
eg I only want the user to be allowed to select from the list of items that are pre
Old question, but here:
var defaultVal = ''; $('#selector').autocomplete({ source: url, minlength: 2, focus: function(event, ui) { if (ui != null) { defaultVal = ui.item.label; } }, close: function(event, ui) { $('#searchBox').val(defaultVal); } });