Vatsal Desai

Vatsal Desai

  • NA
  • 51
  • 11.3k

Problem with Autocomplete textbox event

Feb 20 2015 6:56 AM
i have jquery which process or worked when we select item after it search item.

function SearchText() {
$("#txtsearchcourse").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: '<%=CallingPage %>' + ".aspx/GetAutoCompleteData",
data: "{'strSearchString':'" + document.getElementById('txtsearchcourse').value + "'}",
dataType: "json",

success: function (data) {
response($.map(data.d, function (item) {
return {
label: item.split('##')[0],
val: item.split('##')[1]
}
}));
},
error: function (result) {
alert("Error");
}
});
},
select: function (event, ui) {
document.getElementById('hdnSelectedCourseId').value = ui.item.val;
document.getElementById('txtsearchcourse').value = ui.item.label;
document.getElementById('lnkSearchCourse').click();
}
});
but its not working in safari browser its not getting click & process item. what is problem ???

Answers (3)