I am working on an autocomplete function for a text box and need too fetch ten results at one time and with an option which say get more hyperlink. Currently it fetches all the results.
My code so far is attached below. can you please provide guidance?
$(document).ready(function(){
$('#<%=txtEmployeeName.ClientID%>').autocomplete({
source: function (request, response) {
$("#loading").show();
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "AccountDisclosureSearch.aspx/SearchEmpByText",
data: "{ 'empName':'" + request.term + "'}",
dataType: "json",
success: function (data) {
response($.map(data.d, function (item) {
return {
label: item.split(";")[0],
val: item.split(";")[1]
// name: item.split("|")[0]
}
}))
$("#loading").hide();
},
error: function (response) {
alert(response.responseText);
$("#loading").hide();
}
});
},
select: function (e, i) {
// $("#<%=hempid.ClientID %>").val(i.item.val);
storeEmployee(i.item.label, 0, i.item.val);
},
open: function(){
$('.ui-autocomplete').css('width', '220px');
},
minLength: 3
});
});