1
I’m trying to load data via Ajax by typing a code and clicking TAB it automatically searches the BD and prints in form inputs.
I ran a test on console.log(data)
and the data is being returned but does not load us Inputs of the form
Follows the JS Code
// Busco a Chave de Acesso
$(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!"); },
});
});
});
Add the relevant part to html, and print the part of the object where obs_note, request and type...
– Felipe Duarte
the above print is the result of console.log(data)?
– Sam