Validation Rules
Learn about the different validation rules supported in Formwix.
Validation Types
Each field can have validation rules to ensure proper input.
Loading...
Password Validations
Password fields have additional validation rules:
Loading...
Validation Descriptions
- required: Ensures the field is not left empty.
- minLength / maxLength: Limits the number of characters allowed.
- min / max: Defines numerical limits for a field.
- minDate / maxDate: Ensures a date falls within a specified range.
- pattern: Enforces a regex pattern for validation.
- matchField: Ensures a field matches another (e.g., password confirmation).
Special Note: Passing Regex for Validation
When passing a regex pattern for validation, ensure that it is a string and properly escaped. Here’s how you should pass a regex in Formwix:
Loading...
- Always double-escape (`\\`) backslashes when defining regex inside a string. - Avoid using raw RegExp objects, as validation expects a string.
For detailed type definitions, visit the Type Definitions in the repository.