Validation rules
Rapid form provides a simple way to validate form fields using the refValidation
function. The refValidation
function is used to validate the form fields and show the error messages based on the validation rules.
By default, Rapid Form validates the form fields on the input
event. You can customize the validation event type and the validation rules for each form field, and reset
the form values automatically after its submission.
Let’s the validations rules for the form required fields:
input
field has a minimum length of 1 characters (All types).email
field has a valid email format based on regex./^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
.
password
field has a minimum length of 6 characters.checkbox
field is required.radio
field is required.select
field is required.