1
The autocomplete is working correctly, I get the following json:
[{"label":"Jorge Valdivia","value":"16"},{"label":"Vinicius Aquino","value":"15"}]
The problem is that when I select an option, the input receives the registration ID, I would like to make it display the person’s name in the input.
// -------------- Autocomplete --------------
$('#search_broker').autocomplete({
source: path + "User/get_brokers",
minLength: 2,
select: function (event, ui) {
broker_name = ui.item.label;
broker_id = ui.item.value;
alert('Nome: ' + broker_name);
}
});
Is there any other code besides this?
– Wendel Rodrigues
You are talking about the code on the server that returns the json?
– viniciussvl
No, autocomplete javascript
– Wendel Rodrigues
There’s no, the only JS of the autocomplete I’m using is this.
– viniciussvl