Created
November 5, 2015 19:35
-
-
Save bg451/89c87ac092592d03859d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function errorCheck(form) {\ | |
if (form.firstName.value == "") { | |
errorReport("firstName", "is empty") | |
} | |
if (form.lastName.value == "") { | |
errorReport("lastName", "is empty") | |
} | |
var email_re = /[A-Z0-9._]+@[A-Z0-9.]+\.[A-Z]{2,}/ | |
if (!email_re.exec(form.emailAddress.value)){ | |
errorReport("emailAddress", 'is invalid') | |
} | |
var re = /\d\d\/\d\d\/\d\d\d\d/ | |
if (!re.exec(form.dateOfBirth.value)) { | |
errorReport("dateOfBirth", 'is invalid') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment