Forum Moderators: coopster
The problem is that if I dn't fill in the form..and click on the back button..the validation script is executed and i got an error message popup.I want the validation script to be executed only when I click on the submit button.Is this possible? But still I must use the form action so that I could retrieve the values in the validation script.
A+
I want the validation script to be executed only when I click on the submit button.Is this possible?
Yes.
<form action="myscript.php" method="post">
<input type="submit" name="submit" value="submit" />
</form>
<?php
if (isset [php.net]($_POST['submit'])) {
// form has been submitted, validate entries
}
?>