Validate field values
Last updated
Last updated
This logic helps in creating some validation for taking in the values for a field. If the value entered in the field doesn't match the configured validation, an error message is shown to the user for the field and a successful submission cannot be created.
Let's take an example. We have to set up a process for creating data on the students in a class above 18 years of age. We create a form with Student details like Name, Contact details, Address, etc. along with a field Age and set a validation on it that the Age entered cannot be less than 18 years.
Now, while creating the submission for this form, the user cannot give a value less than 18 in the field Age. If the value entered in the field Age is less than 18 then an error message is given for the field Age if the user tries to submit the form and a successful submission is not created.
Getting back to our example explained above.
While creating the above-quoted form, the user clicks on the Settings tab and select Conditions from the left pane.
Select Validate field values in the list of options shown.
Click on Select Fields and choose the field over which the validation is to be applied as shown in the below image. In our example, we have to apply validation on the field Age.
4. Write down the condition for the field in the input box. The user can write the javascript expression in terms of the field key in the input box marked <2> in the below image or select the field in the formula box and give the condition as shown by <1> in the below image.
5. Write down the error message that should be shown to the user filling up the form in case the field validation fails as shown in the image below.
6. Click on Save to save the configuration and create the form by clicking on Create form in the Build tab.
The form is created with the validation set on the field Age that the value entered cannot be less than 18.
So, while creating the submission if the user enters the value 16, the user can see the error message below the input box.