Set Check box field as required
Function: Set Check box field as required
This action allows you to control whether a specific checkbox on your form must be selected by the user before they can proceed. You can make a checkbox mandatory or optional, and even customize the message shown if a required checkbox is not checked.
Input
- UI element: The specific checkbox field on your form that you want to modify.
- Required: Choose 'True' if the checkbox must be selected by the user, or 'False' if it's optional.
- Required message: The custom text that will be displayed to the user if they try to submit the form without selecting this checkbox when it's set as required.
Execution Flow
Real-Life Examples
Example 1: Make "Terms and Conditions" checkbox mandatory
You have a user registration form, and you want to ensure all users agree to your terms before signing up.
- Inputs:
- UI element: "Terms and Conditions" checkbox
- Required:
True - Required message: "You must agree to the terms and conditions to proceed with registration."
- Result: The "Terms and Conditions" checkbox on the registration form becomes mandatory. Users cannot submit the form without checking it, and if they try, they will see the message "You must agree to the terms and conditions to proceed with registration."
Example 2: Make "Opt-in for Newsletter" checkbox optional
On your contact form, you include an option for users to subscribe to your newsletter, but it's not a requirement to submit the form.
- Inputs:
- UI element: "Opt-in for Newsletter" checkbox
- Required:
False - Required message: (Leave blank, as it's not required)
- Result: The "Opt-in for Newsletter" checkbox on the contact form remains optional. Users can submit the form whether they check it or not, and no error message related to this checkbox will appear.
Example 3: Dynamically require a "Parental Consent" checkbox based on age
You have a form where users declare their age. If a user indicates they are under 18, a "Parental Consent" checkbox should automatically become mandatory.
- Inputs (triggered by user input for age):
- UI element: "Parental Consent" checkbox
- Required:
True(This value would be set by a conditional logic based on the age input) - Required message: "Parental consent is required for users under 18 years of age."
- Result: If a user selects an age under 18, the "Parental Consent" checkbox on the form automatically becomes mandatory. If they then try to submit the form without checking it, they will see the message "Parental consent is required for users under 18 years of age."