I'm trying to load data via Ajax by typing a code and clicking on TAB it automatically searches the DB and prints it on form inputs.
Iranatestwithconsole.log(data)
andthedataisbeingreturnedbutdoesnotloadtheInputsoftheform
FollowtheJSCode
//BuscoaChavedeAcesso$(document).ready(function(){$("#chave_acesso").change(function() {
$.ajax({
method: 'GET',
headers: Alvo.header(),
dataType: 'json',
url: "{{$urlApiSearchKey}}"+ this.value + "",
success: function(data) {
console.log(data);
$('#obs_nota').val(data.obs_nota);
$('#pedido').val(data.pedido);
$('#tipo').val(data.tipo);
},
error: function() {
alert("Código não encontrado!"); },
});
});
});