This repository was archived by the owner on Jul 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 179
input created with weird values #113
Copy link
Copy link
Open
Description
Hi,
I use jquery ui autocomplete.
occasionally for some users the page load and the autocomplete input field init with weird values, like e_16K7 or e_0cbp or _e_0WfF
I believe it is somehow related to the initialization of the autocomplete in a specific scenario or to chrome extensions and/or autofill form plugins.
any ideas?
$that.autocomplete({
source: function (request, response) {
$.ajax({
contentType: "application/json; charset=utf-8",
url: "/services/site_service.svc/.../autocomplete/.../" + request.term,
async: true,
success: function (data) {
var parsed = jQuery.parseJSON(data.data);
response($.map(data.data, function (obj) {
return {
label: obj.name,
labelLng: obj.nameLng,
labelLat: obj.nameLat,
labelShort : obj.ShortName,
value: obj.id,
type: obj.type,
};
}))
},
error: function (result) {
alertsCtrl.infoTitle(globalResources.errorMessageTitle, globalResources.generalservermessage, 3000);
}
});
},
open: function (event, ui) {
// disable arrowNavigation while open
$that.unbind("keydown", obsEcelObj.arrowNavigation);
var results = $(this).autocomplete("widget")[0];
if (results.childElementCount == 1) {
$(results.firstChild).trigger("click");
$(this).autocomplete("close");
}
},
close: function (event, ui) {
// enable arrowNavigation on close
$that.keydown(obsEcelObj.arrowNavigation);
},
select: function (event, ui) {
event.preventDefault();
$that.val(ui.item.labelShort);
$that.data("name", ui.item.labelShort);
$that.data("value", ui.item.value);
$that.data("type", ui.item.type);
$that.attr("title", ui.item.labelLng);
$that.removeClass("Error");
$that.siblings("a.input_species").hide();
$that.data("dirty2", "not");
},
focus: function (event, ui) {
event.preventDefault();
$that.val(ui.item.label);
},
minLength: 2
}).data("uiAutocomplete")._renderItem = function (ul, item) {
return $("<li data-value='" + item.value + "' data-type='" + item.type + "' data-name='" + item.label + "'>")
.append("<a>" + item.label + "</a>")
.appendTo(ul);
}
},
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels