Form Validation

Project Description:

In this project we are going to learn client side form validation using javascript functions and patterns



If you want to create and validate from with the help of description and guidelines above, you can try our Editor above.



If you want to take a challenge don't scroll below

Source code for form validation:


Regular expression(pattern) form validatioin references:

Regular expressions are the specific patterns used to match the characters.Regular expressions are widely used in form validation,searching and many other purposes.


pattern="regular expression"

Regular expression(Pattern) for First Name or Last name validation

Pattern: pattern="[A-Za-z]{2,32}"

This will allow only A-Z, a-z letters with minimum length of 2 and maximum length 32.

Regular expression(Pattern) for Name validation

Pattern: pattern="[a-zA-Z]+[ ][a-zA-Z]+"

This will allow space to write full name.

Regular expression(Pattern) for phone number validation

Pattern: pattern="[7-9]{1}[0-9]{9}"

This will support a number starting with 7,8 or 9 and remaining 9 numbers from 0-9.

Regular expression(Pattern) for Email validation

Pattern: pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"

This will support all kinds of genuine emails.