Reputation: 25759
Let me clarify: I'm using standard jQuery autocomplete plugin (bassistanse.de) and bind it to a KeyValueCollection serialized to JSON (ASP.NET MVC). All works fine, except I want to be able to notify user when he/she types in a value which isn't present in DB, i.e. value not in list.
What are possible ways of solving this?
Ideally, I would like to handle both 'first time error' and 'error after valid choice' cases.
Handling 'blur' event doesn't help, since user can click drop down item (effectively losing focus), and after that the selection immediately will have been made.
Thank you.
Upvotes: 1
Views: 1481
Reputation: 1978
If you look at the demo page, the second example exludes the current month, but if you start typing 'September', the bottom of the page produces a message that says 'No Match'. This is done when the built in 'result' event is fired and it's parameter 'data' is undefined.
Upvotes: 1