It has 14 built-in validation rules such as required, email, URL, date, and more, along with support for writing custom validation logic and HTML5 data attribute validation.
From all the examples above we see how to validate the form data using Java Script.
The Title, Director, and Date Released properties are all marked as required properties.
The Director property must be assigned a string that contains less than 5 characters.
As web developers, we want to protect the information filled out in form fields.
Before you can use the Data Annotation validators, you must download the Data Annotations Model Binder. Next click the Browse tab and browse to the location where you downloaded (and unzipped) the Data Annotations Model Binder sample (see Figure 1). The Display Name attribute enables you to modify the name of the property when the property is displayed in an error message.