Hazel Mahmud

Hazel Mahmud

  • NA
  • 299
  • 65.7k

.click function didn't work

Apr 8 2015 3:03 AM
hello,
can anybody help to solve this.. i have jquery coding below but when i run it, search inside .click function didn't work. how to fix that problem..thanks so much. jquery coding as below :
function SearchID() {
$(".autosuggestID").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "AutoComplete.asmx/GetStaffID",
// data: "{'id':'" + document.getElementById('txtSearchID').value + "'}",
data: "{'id':'" + document.getElementById('<%=txtSearchID.ClientID%>').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");
}
});
},
minLength: 0,
scroll: true,
select: function (event, ui) {
$('#<%= lblstafID.ClientID%>').text(ui.item.val);
var txtstafIDs = document.getElementById("<%=lblstafID.ClientID %>").innerHTML
document.getElementById("<%=txtstafID.ClientID %>").value = txtstafIDs;
}
}).click(function(){
$(this).data("autocomplete").search($(this).val());

});
}

Answers (1)