Validation on enable and disable Text boxes

Validation on enable and disable Text boxes

Comments

  • Hello!
    I have a form with a drop-down and a few text boxes.
    I want to enable and disable text boxes based on the selection from the drop-down.
    Also, I would like only the enabled text boxes to be required for submitting the form.

    I there a way I can accomplish this?

  • Hello!

    Yes, we can accomplish both of these tasks using Form Visibility rule and Form Validation Flow.
    Form Visibility Rule can be used to enable and disable the textbox component.
    We have to make sure that the textboxes are initially disabled so the rule can properly be applied.
    In the Visibility rule configuration, we set the behavior to "enable/disable".
    [color=rgb(127, 140, 141)][font=Roboto][img]att4[/img][/font][/color]

    The trigger would be the Drop-down selection and the Controls would be the text boxes that will be impacted.
    [color=rgb(127, 140, 141)][font=Roboto][img]att3[/img][/font][/color]

    This completes the enable and disable the component. When we run the Flow all textboxes will initially be disabled. When a user clicks on a drop-down select the appropriate text boxes will be enabled for the user to fill in.

    We will need to use a Validation Flow to validate only the enabled textboxes for submission.
    -The inputs for the start step for this flow will be the Drop-down selection and the text boxes associated with the option.
    -Next, the drop-down option will be evaluated using a rule that will check to see which selection was chosen.
    -Then the flow will check to see if the text boxes are empty or not using a rule.

    [color=rgb(127, 140, 141)][font=Roboto][img]att5[/img][/font][/color]
    [color=#7f8c8d]
    [/color]-On the True path, there is a Create Data step that will hold the Validation object for each of the textboxes. We can state the validation message we want here.
    Note: the Data Name must match the data name used on the Flow for the textbox component.
    [color=rgb(127, 140, 141)][font=Roboto][img]att2[/img][/font][/color]
    [color=#7f8c8d]
    [/color]-The Flow output will be mapped to the Create Data Step variables.

    If the validation is broken then the Flow will output the message. If the validation is not broken then the user will be able to submit.
    [color=rgb(127, 140, 141)][font=Roboto][img]att1[/img][/font][/color]

    Back in the Form Designer, we will update the inputs and for the trigger, we can select the Drop-down component.

    The result will look similar to this:

    [color=rgb(127, 140, 141)][font=Roboto][img]att6[/img][/font][/color]

    For more information on visibility rules and validation Flows please use the links below:
    [url=https://documentation.decisions.com/docs/form-validation-flow]https://documentation.decisions.com/docs/form-validation-flow[/url]
    [url=https://documentation.decisions.com/docs/form-components-visibility-using-flow-data]https://documentation.decisions.com/docs/form-components-visibility-using-flow-data[/url]
    [i]edited by faiza@decisions.com on 4/2/2020[/i]

Sign In or Register to comment.