Created
November 23, 2015 17:32
-
-
Save dave-jay/cc9976ca0c9fada59e49 to your computer and use it in GitHub Desktop.
phone_validation
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
if (theType == 'Phone') { | |
if(theFieldValue.charAt(0) == '1'){ | |
alert("The number should not start with 1"); | |
return false; | |
} | |
if (theFlag) { | |
// Required Entry | |
theRE = eval("/^[0-9]{10,10}$/"); | |
} else { | |
theRE = eval("/^$|^[0-9]{10,10}$/"); | |
} | |
if (theRE.test(theFieldValue)) { | |
} else { | |
alert("Must be ONLY 10 number digits with no prefix. Area code and numbers only.."); | |
eval(theField + ".value = ''"); | |
retVal = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment