I've this code
$("#tb1").autocomplete({
source: function (request, response) {
$.ajax({
url: "../mycontroller/getdata",
dataType: "json",
data: { strText: "" },
success: function (Data) {
response($.map(Data.Data, function (item) {
return {
label: item.Name,
value: item.Id
};
}));
}
});
},
minLength: 1,
select: function (event, ui) {
alert(ui.item ? "Selected: " + ui.item.label : "Nothing selected, input was " + this.value);
}
});
I get the result in textbox, however it shows all the items in list instead of showing seleted items.
For example:- After i enter "ab" in textbox it should display all the items with ab but it shows items with ca, as and other alphabets combinations.
what am i doing wrong, how can i resolve it?