Jquery Autocomplete clear textbox if no match found
I am using Jquery's autocomplete plugins to show smart search textbox in my application.
To get better Idea plz refere following url
http://docs.jquery.com/Plugins/Autocomplete
Now what I want is, When user goes on typing in the textbox respected filter result get append to the textbox which is fine. If the user types character which doesn't match the result then I want to clear that character.
Means any how I want to force the user 开发者_运维问答to type only those characters that are in the autocomplete result.
Thanks in advance.
Sachin
$('#'+Artist.id).autocomplete(responce, {
matchContains:false,
minChars:1,
autoFill:false,
mustMatch:true,
cacheLength:20,
max:20
});
you can override .autocomplete(responce) with the one mention above and set the parameter as per your requirment.
The MustMatch=true solve my problem.
精彩评论