hello friends I have a registration form with a div below that shows all the records the idea is that when someone registers I refresh that record div with a function or something like what I do not want to actually have to bring back those data that are already from ajax any idea or tips thanks in advance
php code
<div class="body">
<div>
<form method="post" id="form_add">
<input type="text" class="form-control" id="txt_medidas"
<button type="submit" class="btn btn-primary">+</button>
</form>
<div id="tabla_datos">
<?php
...
foreach( $reg) { echo $reg->dato(); }
...
?>
</div>
</div>
javascript code
$(document).ready(function(){
$("#form_add").submit(function(){
$.ajax({
url: "post_add.php",
type: "POST",
data: $("#form_add").serialize(),
success: function(data){
if(data){
alert('OK');
}else alert('Error al guardar');
}
});
return false;
});
});