I recently migrated a few of my Autocomplete plugins from the one produced by bassistance to the jQuery UI autocomplete.
How can the \"mustMatch\" and \"selectFirst\
I discovered one issue. While the suggestion list is active you can submit your form even if the value doesn't match the suggestion. To dissallow this I added:
$('form').submit(function() {
if ($(".ui-autocomplete li:textEquals('" + $(this).val() + "')").size() == 0) {
$(this).val('');
$("span").text("Select a valid city").show();
return false;
}
});
This prevents the form from being submitted and displays a message.