'Add Input Validations' page |
In this page you can attach validations to the fields. The validations are meant to prevent your visitors from entering invalid or inconsistent data.
The layout of the pageThe left side box shows the form shows the input fields and the validations in a tree structure. Select the input element from the left side box and you can select the validations on the right side.
Editing the properties of the validationSelect a validation node from the left side. The right side shows the properties of the validation.
Error String See: How to edit the validation error messages
Conditional Validation
See: How to add a conditional validation
Validation OptionsPress the options button to edit the general validation options.
Custom Validation Function
The custom validation function has a single parameter: the form object. If you have more than one validations, then you can ladder all those conditions in the same custom validation function.
If the validation fails, the function should return an object containing the element and the error message like this:
See: How to add your own validations
When to trigger the validations In the second case (validation on submit), the validation done only when the form is submitted. Please note that in the first method, the form submission also triggers all the validations. It makes sure that form is submitted only after the validations.
How do you want to display the error messages
Floating error box style
![]() Floating error box shown in the browser
Single error box on the top of the form ![]() Single box error shown in the browser
See Also:
Unique validation requires Database
|