Validation Types
How many different ways or types of validation can we carry out.- → Scenarios: When to Validation
- → Required Inputs
- → Min-Length Validation
- → Data Type Validation
- → Custom Expression Validation
Data Type Validation
Whether a field is required or not, a field can be checked for Data Types and Data Formats. If a field is not required, DATA TYPE validation is checked only if the input has value.The input attribute data-val-checkType is used to specify data type and data-val-checkFormat is used to specify format within a data type. Data types can be checked without checking the data format. Data format can only be specified for its corresponding data type.
You can set the following data types and some data formats for some these data types:
Numeric | Alphanumeric | Email | URL | Phone | Date | Time
Some data types can be forced so that users cannot type non-allowed characters in the text fields.
- → See examples here
Follow these links to see examples of Data Type and Data Format validations:
- → Data Type Tests: Numbers
- → Data Type Tests: Integers
- → Data Type Tests: Floats
- → Data Type Tests: Alphanumeric
- → Data Type Tests: Emails
- → Data Type Tests: URL
- → Data Type Tests: Phone
- → Data Type Tests: Date