0
I am using some libraries of Boostrap, as the one of the balloons of Alert, and would like to show them depending on the result AJAX, how can I send a post with AJAX and return the errors/successes on Divs, in this case it is better to return in JSON or Plain text, since the errors are independent?
<form action="" method="post">
<input type="text" name="teste" />
<input type="submit" name="post" />
</form>
The back-end part (PHP) is already done, and would return JSON, ex:
Error: JSON => {"error":"1","name":"incorrect"}
<div class="alert alert-danger fade in">
<p>O form contém erros bla bla</p>
</div>
Hit: JSON => {"error":"0"}
<div class="alert alert-success fade in">
<p>Salvo com sucesso!</p>
</div>
Thanks ,for the reply, but how would send with ajax?
– Thiago