Ask AI
Skip to main content

Set 'slide toggle field' as required

Function: Set 'slide toggle field' as required

This function allows you to control whether a 'slide toggle' component on your form must be interacted with by the user before they can proceed. You can make it mandatory or optional, and even customize the message shown if it's required but not completed.

Input

  • UI element (PART - slide-toggle): This is the specific 'slide toggle' component on your form that you want to adjust. You must select the exact slide toggle you intend to modify.
  • Required (BOOLEAN): Choose 'Yes' if the selected 'slide toggle' must be enabled or disabled by the user. Choose 'No' if the user can leave it as is without affecting form submission.
  • Required message (STRING): If you set the 'Required' input to 'Yes', this is the custom message that will appear to the user if they try to submit the form without interacting with the 'slide toggle'. If left blank, a default message will be used.

Output

This function does not produce any direct output. It modifies the behavior of the selected 'slide toggle' component on your form.

Execution Flow

Real-Life Examples

Here are some practical ways you can use the "Set 'slide toggle field' as required" function:

Imagine you have a form where users need to agree to your terms and conditions. You want to ensure they explicitly enable a 'slide toggle' for this.

  • Inputs:
    • UI element: "Terms & Conditions Consent" (your slide toggle component)
    • Required: Yes
    • Required message: "Please agree to the terms and conditions to proceed."
  • Result: The "Terms & Conditions Consent" toggle on the form will now be mandatory. If a user tries to submit the form without enabling this toggle, they will see the message "Please agree to the terms and conditions to proceed."

Example 2: Making an optional newsletter opt-in

You have a 'slide toggle' for users to opt-in to a newsletter, but it's not essential for form submission.

  • Inputs:
    • UI element: "Newsletter Opt-in"
    • Required: No
    • Required message: (Leave blank)
  • Result: The "Newsletter Opt-in" toggle on the form will be optional. Users can submit the form whether they enable or disable this toggle, and no error message will appear if they don't interact with it.

Example 3: Updating the error message for an existing mandatory toggle

You already have a mandatory 'slide toggle' for privacy policy acceptance, but you want to change the error message displayed if it's not enabled.

  • Inputs:
    • UI element: "Privacy Policy Acceptance"
    • Required: Yes (confirming it remains mandatory)
    • Required message: "You must accept the privacy policy to continue."
  • Result: The "Privacy Policy Acceptance" toggle remains mandatory. However, if a user fails to enable it before submitting, the error message displayed will now be "You must accept the privacy policy to continue."