I am using DevBridge jQuery auto-complete, which is working fine but I want to force the user to select an option from the drop down list.
Is there any way to do this?
var airports = [
{ value: 'Manchester (MAN)' },
{ value: 'Bangkok (BKK)' },
{ value: 'New York (JFK)' }
];
$('#autocomplete').autocomplete({
lookup: airports
});
The function I've used is onInvalidateSelection
$("#MyField").autocomplete({
onInvalidateSelection:function(){
$("#MyField").val("");
}
});
That's what worked best for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With