Conditionally Show Checkbox if there is validation triggered

Certified Senior Developer

Hi,

I need to show a check box in UI on click of Submit button, if there is a validation triggered on Submit.

The check box should not be visible otherwise.

If there is no validation getting triggered in UI then the form should just submit.

How can we achieve this.

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents
  • Why not fire the validation whilst the form is being filled in (i.e. not defer until the 'Submit' button is selected)? That way the checkbox visibility can be fired by the same rule that is sued to conduct the visibility. And, in fact, the 'Submit' button's disabled status could also be controlled by the same rule, so it becomes very clear that you can't Submit until you've addressed the condition that the validation rule is setting.

  • 0
    Certified Senior Developer
    in reply to Stewart Burchell

    Yes we can do it when the form is being filled.

    But as per requirement, it has to happen in Submit.

  • 0
    Certified Lead Developer
    in reply to best

    I believe there's no way to do this exactly as you've stated - you would need to either use Stefan's approach of a 2-click process to first run a pre-validation then either submit or show the checkbox and submit, OR use Stewart's approach of running live validation in the background as the form is filled and showing the checkbox BEFORE the user attempts to submit, when applicable.  Honestly this (latter) solution is far more user friendly, as you're not surprising them with some "gotcha" extra requirement when they thought they were ready to submit.

    Also: remember that requirements don't and can't dictate design.  They're two separate things.  Many product owners have no concept of this of course, but that doesn't change the reality of it.

Reply
  • 0
    Certified Lead Developer
    in reply to best

    I believe there's no way to do this exactly as you've stated - you would need to either use Stefan's approach of a 2-click process to first run a pre-validation then either submit or show the checkbox and submit, OR use Stewart's approach of running live validation in the background as the form is filled and showing the checkbox BEFORE the user attempts to submit, when applicable.  Honestly this (latter) solution is far more user friendly, as you're not surprising them with some "gotcha" extra requirement when they thought they were ready to submit.

    Also: remember that requirements don't and can't dictate design.  They're two separate things.  Many product owners have no concept of this of course, but that doesn't change the reality of it.

Children
No Data