When you want to submit a form without updating the page, if you think about Ajax, that is a practical way to do it. But would there be another way to do this 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 it validates the input
field with the function:
function valida(i){
if(!i.nome.value || i.nome.value.trim() == ''){
alert("Digite um nome");
return false;
}
// validou
}
How to submit this form to the PHP pagina.php
page without Ajax and without refreshing the page and still return a confirmation that the form was received?