Validation can make sure the data you receive follows certain formats or constraints. That is why we allow for several ways to validate data on submission.
To add validation to a field, simply click the 'pencil' icon next to its label.
A modal will appear with different field options. Select 'Data validate' from the list.
Switch 'Data validate' to 'on'. You will now see the validation-specific options appear.
For every type of validation, you will always be able to enter the 'Message Validation', which is the message that is shown when the validation is triggered.
The other possible options differ per data type:
Validations on text fields
- Email: Checks if the filled-in text is a correctly formatted email address.
- URL: Checks if the filled-in text is a correctly formatted URL.
- Contains: Checks if the filled-in text contains the specified word(s).
- Does not contain: Checks if the filled-in text does not contain the specified word(s).
- Between: Checks if the filled-in text is between x and x characters long. It is also possible to only specify an upper or lower limit, thus checking for a minimum or maximum amount of characters.
Validations on number fields
- Between: Checks if the filled-in number is found between the two given numbers. It is also possible to only specify an upper or lower limit, thus checking for a minimum or maximum number.
Validations on date fields
- In the future: Checks if the filled-in date lies in the future.
- In the past: Checks if the filled-in date lies in the past.
- Before: Checks if the filled-in date lies before the specified date.
- After: Checks if the filled-in date lies after the specified date.
Comments
0 comments
Please sign in to leave a comment.