Hey,
Not sure what the problem is, but here's a snippet of code that I normally use (Note: I only left the e-mail part in it. I normally expand this to run a function validate_required for other fields to check for null values. If you want the full code, let me know):
/**
* This function validates the form
*/
function validate_form( thisform ) {
with ( thisform ) {
/**
* E-mail
*/
if ( validate_email ( email, "Please enter a valid e-mail address." ) == false ) {
email.focus();
return false
}
}
} // end function validate_form
/**
* This function checks for a valid e-mail address
*/
function validate_email( field, alerttxt ) {
with ( field ) {
apos = value.indexOf( "@" )
dotpos = value.lastIndexOf( "." )
if ( apos <1 || dotpos-apos < 2 ) {
alert( alerttxt );
return false
} else {
return true
}
}
} // end function validate_email
And then in your form, just add this to the form tag:
onsubmit="return validate_form(this)"
Also make sure your field names match up with the ones in your JS file.
Hope this helps!