How do I validate input data?
Background
It uses Formvalidation.io framework for validation.
Form validation can be turned on per form / per field.
By default, all forms in the admin panel are set to form validation and by default the fields are not.
in other words anything can be entered by default.
Hence form validation. It can be useful to add some more structure to the input of fields.
This is done by entering advanced parameters. These are entered as data attributes. In HTML these are recognizable by including data-* in the tags.
Advanced parameters cannot be controlled directly by data attributes.
i-Reserve uses CamelCasing instead of dashes.
Example
Example: we want to include an integer (numeric) check.
We start by adding a "text" field. Validations only work on text fields!
Source: https://formvalidation.io/guide/validators/integer/
Core data attribute: "data-fv-integer".
We translate this into a parameter: we remove all dashes ("-") and capitalize the next character.
"data-fv-integer" then becomes "dataFvInteger".
Then that's the parameter. The value of this parameter must then be "true".
And let's go one step further: the options can also be set.
"data-fv-integer___message" becomes "dataFvInteger___message"
This page is primarily intended for the management panel.
And the forms that apply to the management panel.
One module has been implemented with Form Validation on the customer pages, namely "General forms"