gachris said:
I have a return false as part of my if statement and my form is still
submitting.
Here is the simple example. Any suggestions?
if(msg != ""){
alert(msg);
return false;
}else{
//submit the form
}
Most commonly this is because your validation function is returning
false to the onsubmit handler, but the onsubmit handler function
is not returning that value to the browser. The onsubmit handler
is the value of the HTML onsubmit attribute (usually), so instead
of something like:
onsubmit="myValidationFunction(this)"
you should have something like:
onsubmit="return myValidationFunction(this)"