I am using the jQuery autocomplete plugin. Is there a way that when a user enters a textbox (that is wired up to have autocomplete) the list appears with the top alphabetical items? Some sort of trigger?
jQuery Code
$('.someTextbox').autocomplete({
source: function (request, response) {
$.ajax({
url: serviceUrl + "/AddDocumentLinesService.svc/GetLineTypes",
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false,
data: {
maxRows: 10,
textStartsWith: request.term
},
success: function (data) {
response($.map(data, function (item) {
return {
label: item.LineTypeCode + ' - (' + item.Description + ')',
value: item.LineTypeCode
}
}));
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
}
});
}
});
I would like it so that the second the user enters the '$('.someTextbox')' textbox the list appears.