We can divide the validation in two ways:
Basic Validation: In this type validation, the form must be checked to make sure that all the mandatory fields are filled in. Example: First Name, Last Name is a mandatory field.
Format Validation: In this type validation, the data that user entered must be checked for correct format or as required. Example: the email format or an age range.
Example of Basic Validation:
Example of Format Validation:
Where we will validate the form by thing in our mind: 1. The Email must be a valid email. 2. The age must be a number and must be between 25 and 35.