I saw a similar question posted here, but the answer did not help me.
I call this:
$("#Location" ).autocomplete({
source: function(request, response) {
$.ajax({ url: "searchAutoComplete.asp?Location=all",
data: { term: $("#Location").val()},
dataType: "TEXT",
type: "POST",
success: function(data){
response(data);
//response(eval('[' + data + ']');
//alert(data);
}
});
},
minLength: 2
});
My results end up looking like this:
A
P
P
L
E
,
B
A
N
A
N
A
How do I solve this?
Thanks in advance
The source callback needs to be invoked with an array of strings, not a string. If you response contains a comma separated string, you should split it and pass the resulting array to
response: