Using validation rules
Validation rules can be set on any input field in your form. They allow you to specify a variety of constraints on the values accepted by the input field, including whether the field is required to submit the form. When multiple validation rules are available it is possible to select multiple rules.
Accessibility
Helper and validation texts are made accessible-friendly. Inputs are linked to active helper and error messages using aria-describedby, and invalid fields are marked with aria-invalid. Visible error messages include role="alert" and aria-live="assertive to ensure assistive technologies announce them immediately.
Autocomplete attributes has also been automatically added for email and telephone fields.
Text Input Field
Jahia default text input field has 5 available validation rules that you can use to guide users of your forms and improve the quality of data you capture
- Required allows you to make the field input mandatory (accessibility friendly)
- Equal To allows you to compare the input value to another value in the form, but can only be when at least one other field is present on the form
- Number of Characters is an important constraint when you are planning to push the data from your forms into other systems as some downstream systems will have limitations on the number of characters accepted.
- Range is another useful parameter, but only applies to numeric values for this input, the numeric values captured will be stored as string. Jahia added dedicated numeric and phone input types in Forms 3.3.
- Regular Expression is the most powerful and specific of the built in validation rules for this input field, allowing you to specify the format of value accepted