Form Features - Validations
Overview
SharinPix Form Questions can be configured to be valid only when certain conditions are met. Validations can be used to ensure that form answers are in the correct format and valid. This configuration is available in the SharinPix Form Builder.
This article covers the following:
Getting Started
Adding Validations using Required option
The simplest way to add validations to a Form Question is to use the required option. It makes a question mandatory and prevents form submission unless that question has an answer. This feature is available for most questions and can be enabled by ticking the required checkbox as shown below.
The picture below demonstrates the required feature configured on the Date question:
- The required Date field contains an asterisk * in its label.
- It is highlighted with a message if it has not been filled when trying to submit the form.
- There are no error messages once the question has been answered.
Configuring a Validation Rule
A validation condition can be configured for a SharinPix Form Question using the "validation rule" field in the SharinPix Form Builder.
This field can be found in the advanced tab for Question elements and takes as input an expression that evaluates to True or False (boolean).
The example below shows:
- A validation rule that ensures the value of an input is exactly 10 characters in length.
- A custom message is configured for that validation rule using the "Message when invalid" field. This field is a SharinPix Formula Field and takes as input an expression that evaluates to a string.
Tips:
For more information on the Functions and Expressions of the SharinPix Formula Field, please follow the article below: Form Formulas
Demo: Serial Number field with Validation Rule
This example demonstrates the Validation Rule feature within an Air Conditioning Inspection example. It ensures that the correct serial number is entered for an air conditioning unit.
The validation rule for the text element - 'Air conditioning unit serial number' is configured as shown below.
The diagram below shows:
- No error messages are shown when the serial number question is empty and the form has not yet been submitted.
- The serial number question is highlighted and a custom error message is shown when it is incorrectly filled.
- There are no error messages when the correct serial number is entered.
0 Comments
Add your comment