Below is the code for my autocomplete. The problem is that it mostly works. Say I have a bunch of results that are like test1, test2, test3, etc. If I type “t” they popup, when I put an e in “te” they disappear. Then if I put in the “s” it narrows it down further. it’s not always the second letter either. It just seems sporadic. Please help. I have confirmed the data coming back is solid, so it’s nothing on the backend.
//Server autocomplete
$("#txtSearchServer").keyup(function (event) {
$.ajax({
url: 'edit/EditService.svc/SearchServers',
type: 'GET',
data: { 'term': $("#txtSearchServer").val() },
dataType: 'json',
success: function (data) {
var listServers = [];
$.map(data.d, function (item) {
///working here to do server autocomplete!!!!!!!
listServers.push(item.ServerName);
$("#txtSearchServer").autocomplete({
source: listServers
});
});
},
error: function (a, b, c) {
$('.Toast').html('Error Retreiving Servers for autocomplete!');
}
});
});
Looking at your code you are doing asp.net
SO this should work for you: