I have several forms with a submit button and I want to have conditions on these buttons so they get greyed as long as mandatory fields are not filled and valid.
Once the mandatory fields are filled & valid, the button becomes colorful.
What is the best method to do so? In order not to repeat bunch of conditions and get these gigantic ugly conditions as on this screenshot ?
Can’t you just use “this input should not be empty”/“this checkbox should be checked” property on each field? As soon as your submit button uses these fields - WF will not start.
Yep, not the best UX for users, but better value in terms additional work for developer
I guess the easiest way is to use some JS that listens to inputs/checkboxes and changes the button style (color) and state (clickable or not).
To make it in native Bubble you can use custom state for each input/checkbox. For example, when input is changed and when it’s not empty - set state 1., when opposite - set state 0. In the conditionals calculate the sum of custom states. If it’s equal to the number of mandatory inputs/checkboxes - make the button clickable and change the style. So you’ll have less overloaded expression in the button’s conditionals, but you’ll have to deal with additional WFs and custom states.