Autocomplete Select Problem in iOS
The user has to select the autocomplete result twice to trigger the select event in iOS 9. I have an iPad 1 that's running iOS 5 and it works fine as it does on any other browser, but not on the later versions of iOS.
I have searched everywhere for a solution, but nothing seems to work. Tried variations of this
solution .
Does anyone have a fix for this?
Thanks for any help!
Code:
- $("#<%=txtEmail.ClientID%>").autocomplete({
source: function (request, response) {
$.ajax({
url: '<%=ResolveUrl("~/WebService.asmx/GetVisitorEmail_SignIn") %>',
data: "{ 'prefixText': '" + request.term + "'}",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
success: function (data) {
response($.map(data.d, function (item) {
return {
label: item.split('-')[0],
val: item.split('-')[1]
}
}))
}
});
},
select: function (event, i) {
$("#<%=HFVisitorID.ClientID%>").val(i.item.val);
$("#<%=txtEmail.ClientID%>").val(i.item.label);
$get('btnSubmitAutoCompleteValue').click();
},
minLength: 1
});