How to disable a button based on the background color of an input

Good day fellow Bubblers.

I have a repeating group that deals with dynamic values based on certain variables. Because of this numbers for a specific record input must sometimes be positive and sometimes negative. I use the Condition function to highlight the input background in red if the entered value is not as it should be.

I use auto binding to update values in the repeating group. When this group is to be handed over to the next person in the workflow, the current user clicks a button to update a master table for the batch with the flag that indicates it is ready for the next person.

What I would like to do is some sort of validation check before committing the transaction. ie. If any background color of input A in RepeatingGroup A is red, then disable button.

Is this at all possible?

What I would probably do is add a custom state to any element on the page to store any “errors”. You could make this custom state a list of texts. Then, whenever the value of one of the inputs that you’re interested in changes, you could add a text that represents that input to the custom state ONLY WHEN the value isn’t what you want it to be.

When the user finishes the form, then, if that custom state contains any items at all, you know the user must have done something wrong, and you can disable the button or do whatever you like to prevent them from moving to the next step.

Hope this helps!

This topic was automatically closed after 70 days. New replies are no longer allowed.