I have a form that, after being submitted, displays the result on a second page, type:
<form method="post" id="form" action="form.php">
<input name='nome' id='nome'>
<input type='submit' value='Enviar'>
</form>
And no form.php
something like:
$nome = $_POST['nome'];
echo "O nome é $nome";
This question is answered how to reset the data when the request is processed on the same page, but I need the data that has been filled out to be completely zeroed if the user returns the page through the browser button or using the keyboard. I tried:
<script>
$('#myForm')[0].reset();
</script>
But it did not work. What I need is that if the user returns to the page, the field is no longer filled. The form has several types of fields (select, input, checkbox, radio), and I need to reset all.
I read several issues in SOen, but due to the language barrier I was even in doubt about this is even possible.
Is it possible? How?