Hi all,
I have a personal simple jQuery validation script.
It works when the submit button is clicked and sets up a variable:
$errors = false;
Then there are series of if
statements that check for textbox values and conditions, and if conditions are not met, variable $errors
is set to true
.
The script works except for one thing. If all textbox conditions are met (correlating to false $error variable), the script does not send the form. This is how the script ends:
if ( ($errors = true) ) {
return false;
}
else if ( ($errors != true) ) {
//nothing
return true;
}
I've tried removing the return true;
, replacing it with return
, and nothing worked. Why does it not send the form?!? It's as if it's constantly stuck on the return false;
location.
Now, if I comment out return false;
, the script shows the errors and sends the form. Obviously we don't want to send the form if there are errors.
Any help would be appreciated,
Thanks! Amit