1
<script type="text/javascript">
$(function($) {
$('#enviaadv').submit(function() {
//document.getElementById('btnConsultar').disabled = true;
$('div.mensagem-erro').html('');
$(this).ajaxSubmit(function(resposta) {
if (!resposta){
$onclick = showadv('bottom','left',resposta);
}
else
{
$onclick = showadv('bottom','left',resposta);
}
});
return false;
});
});
</script>
I’m receiving JSON data on resposta
thus:
{"adv_nome":"Gabriel","adv_id":"8c7dac3ea415b863c8c8789b6667b2b1"}
How can I treat this data to get adv_nome
and adv_id
?
Imagine you want to play in one
input
, would be so:$('#id_do_input').val(resposta.adv_nome);
– Ricardo Pontual
tried to do so $name.val(reply.adv_name); $onclick = showadv('bottom','left',name); did not give
– Joao Pedro P M