2
When you want to send a form without updating the page, you think of Ajax, which is a practical way to do this. But there would be another way to do it without using Ajax?
For example, I have the following form:
<form name="form" action="pagina.php" onsubmit="return valida(this)" method="post">
<input name="nome" type="text" />
<br />
<input type="submit" value="Enviar" />
</form>
And worth the field input
with the function:
function valida(i){
if(!i.nome.value || i.nome.value.trim() == ''){
alert("Digite um nome");
return false;
}
// validou
}
How to send this form to the PHP page pagina.php
without Ajax and without updating the page and still return a confirmation that the form has been received?
I decided to delete - temporarily - my answer. " But is there any other way to do this without using Ajax (using Javascript or jQuery)?" I understood that it would be without jQuery’s Ajax and not without the "Asynchronous Javascript And XML".
– Valdeir Psr
But yes, there is a way to do this. There is even a site that has created a Chat no software for users, no firewall or proxy problems, no dynamic HTML, no Javascript or Java, no Flash and no reload. http://zesty.ca/chat/ Reference: http://www.aaronsw.com/weblog/ajaxhistory
– Valdeir Psr