No need to write even a single Java Script line for simple form validation.
View example » Parsley is shipped with more than a dozen useful validators.
For that we use the seacrh() method and two more regular expressions: /(a-z) / and /(0-9)/.This wont be perfect validation it is possible to slip not compliant addresses by it but it's normally good enough.validate Phone ( ) The function below checks if the phone number is valid.Also, the @ must not be the first character of the email address, and the last dot must at least be one character after the @ sign.
At first we check if the user entered anything at all in the email field.
If its not blank, we check the length of the string and permit only usernames that are between 5 and 15 characters.