0
Does anyone know why this AJAX
isn’t it working? The variables are receiving the values, only the part of sending the data to actualiza.php
is that it doesn’t work.
$("#btnedit").click(function(){
var proc=$("#procedit").val();
var nome=$("#nomeedit").val();
var cc=$("#ccedit").val();
var data_nasc=$("#data_nascedit").val();
alert(proc);
alert(nome);
alert(cc);
alert(data_nasc);
$.post("actualiza.php",{ proc: proc, nome: nome, cc: cc, data_nasc: data_nasc },
function(data)
{
$("html").html(data);
});
});
What
actualiza.php
should return? If possible, add the return leg of this page.– user28595
Have you checked whether a request is sent to "update.php"? What are the criteria to determine if it failed? the expected content is not added to the "html" element? Why failure might be in the PHP script as well.
– mau humor
In the
actualiza.php
I just have to receive the variables and show them like this:<?
 $n_proc = $_POST['proc'];
 $nome = $_POST['nome'];
 $cc = $_POST['cc'];
 $data_nasc = $_POST['data_nasc'];

 echo $n_proc;
 echo $nome;
 echo $cc;
 echo $data_nasc;
?>
– programmer2016
I tested this code here, and as I imagined, a request is sent normally.
– mau humor
There was one missing
}
in the codephp
, had made aif
before sending the variables and had not closed the cycle. But I really thought I had done AJAX badly. Thank you.– programmer2016
You need to take a closer look at this to identify exactly where the problem is. Make sure a request is actually made. Check the status of this request. Check that "Function" is executed ...
– mau humor
Okay, so this settled :D
– mau humor