Skip to content Skip to footer

How to apply validity condition on any widget

Validity Condition section in the property section for any widget is used to specify a condition to validate the field.

If you set any validity condition, it implies that the widget will only be valid if it satisfies the condition that you have set.

Validity condition can be set by specifying the condition by clicking on ‘condition not specified’ link. Refer below screenshot –

For example, if you take a text box ‘Describe your last job’ which will be only valid if the user enters ‘Yes’ in the earlier field ‘Have you got job experience?’

Otherwise, it would be invalid and show an error message.

Steps to set the Validity condition-

  1. Navigate to form builder tab.

2. Create form (Employee details)

3. Add the widgets

a. Choice list (Have you got job experience?) with ‘Yes’ and ‘No’ choices

b. Textbox (Describe Your Last Job)

4. Click on Textbox widget and scroll down in Properties section on the right.

5.Click on ‘condition not specified’ in validity condition section.

6. Click on +sign.

7. Select the respective fields and operator to apply the condition as-

a. Field- Have you got job experience?

b. Operator- Contains

c. Field- Fixed value

d. Fixed choice- Yes

8. You can also customize an error message that you want to display by typing the message in ‘Validity Error Message.’ This message will be displayed when the validity condition does not match with the given input.

To add the validation error message, click on the empty button in validity error message property below.

Enter the validation error message in the textbox. Let’s say, “This field is for experienced people only.”

8. Save the form and publish the app

9. Navigate to Fill form and select the form (Inspection form)

10. If the ‘Yes’ option in the ‘Have you got job experience?’ choice list field is selected then the ‘Describe your last job’ field will be valid. And if the ‘No’ option is selected then the ‘Describe your last job’ field will be invalid and the validity error message will be displayed.

Validations can help you control the type of input during the form filling by the user.

Was This Article Helpful?

0
0 Comments

There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *

Close Bitnami banner
Bitnami