Set radiobutton field as required
Function: Set radiobutton field as required
This action allows you to control whether a specific Radio Button field on your application's form must be filled out by the user before they can submit the form. You can also customize the message displayed if the field is left empty.
Input
- UI element (PART): The specific Radio Button field on your form that you want to modify. This is a required input.
- Required (BOOLEAN): Choose 'Yes' if the field must be filled out, or 'No' if it's optional.
- Required message (STRING): The custom message that will appear if the user tries to submit the form without selecting an option in this required Radio Button field. If left blank, a default message will be used.
Output
This action does not produce any direct output. It modifies the behavior of the specified UI element within your application.
Execution Flow
Real-Life Examples
Example 1: Making a field mandatory
Imagine you have a user registration form and you need to ensure that every user selects their gender.
- Inputs:
- UI element: "Gender Selection" (a Radio Button field)
- Required: Yes
- Required message: "Please select your gender to complete registration."
- Result: The "Gender Selection" radio button field will now be mandatory. If a user tries to submit the form without selecting an option, they will see the message "Please select your gender to complete registration."
Example 2: Making a field optional
Consider a feedback form where you ask users about their preferred contact method, but it's not critical information.
- Inputs:
- UI element: "Preferred Contact Method" (a Radio Button field)
- Required: No
- Required message: (Leave blank)
- Result: The "Preferred Contact Method" radio button field will no longer be mandatory. Users can submit the form without selecting an option, and no error message will appear for this field.
Example 3: Customizing the required message for an existing mandatory field
You have an existing order form with a mandatory "Shipping Option" radio button, but the current default message is too generic. You want to make it more specific.
- Inputs:
- UI element: "Shipping Option" (a Radio Button field)
- Required: Yes
- Required message: "Kindly choose a shipping method to proceed with your order."
- Result: The "Shipping Option" radio button field remains mandatory. However, if a user attempts to submit the form without selecting a shipping option, they will now see the customized message: "Kindly choose a shipping method to proceed with your order."