I'm starting to learn jQuery. But I can't find the solution to this "simple" problem? When I choose a "label" in my autocomplete inputbox, it eventually displays the "value". But I want the "label" to stay in that input box and the "value" I want to put in a hidden inputbox. This is my code for autocomplete for the moment:
$("#input_autocomplete").autocomplete({
minLength: 2,
source: availableTags,
change: function(e, ui) {
if (!ui.item) {
$(this).val("");
}
},
response: function(e, ui) {
if (ui.content.length == 0) {
$(this).val("");
}
}
}).on("keydown", function(e) {
if (e.keyCode == 27) {
$(this).val("");
}
});