Hello, I have the following script, autocomplete:
<script type="text/javascript">
$(document).ready(function () {
$(".nomeCliente").autocomplete({
source: function (request, response) {
$.ajax({
url: "/PreVenda/CarregarCliente",
type: "POST",
dataType: "json",
data: { nome_razao: request.term },
success: function (data) {
response($.map(data, function (item) {
return {
label: item.nome_razao,
value: item.nome_razao,
id: item.id
};
$("id_cliente").val(data.id);
}))
}
})
},
messages: {
noResults: "", results: ""
}
});
})
</script>
I would like to know how to put the ID in a hidden