How to implement a logic any validation is triggered, the button is disable.

There are many components in my interface, and each component has their own validations. I want to implement a require like if any validation is triggered, the submit button should be disable. Is there any easy way I can achieve that? Or I can only write all the validations again in disable.

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Senior Developer

    Hi  

    You can use the "validate" parameter in the submit button, so if any validation is triggered in any of the components, the submit button will not submit the form.

    But if you need to disable the submit button, I suggest creating a rule for validations, keeping every component validation in that expression rule, and using the rule in components and also in the submit button at the disable parameter. Whenever any validation occurs, make disable true.

    Hope this helps! Looking forward to seeing other approaches as well.

Reply
  • +1
    Certified Senior Developer

    Hi  

    You can use the "validate" parameter in the submit button, so if any validation is triggered in any of the components, the submit button will not submit the form.

    But if you need to disable the submit button, I suggest creating a rule for validations, keeping every component validation in that expression rule, and using the rule in components and also in the submit button at the disable parameter. Whenever any validation occurs, make disable true.

    Hope this helps! Looking forward to seeing other approaches as well.

Children
No Data