How to make a button only clickable when all inputs in separate repeating group cells aren't empty?

Hi!

I’m currently struggling with a feature that dynamically shows questions through repeating groups. These questions are split up into required and optional questions & a user should only be able to press next when all required questions are answered (aka their corresponding inputs aren’t empty).

I feel like this shouldn’t be very difficult and I’m just making it too hard for myself, so I would love to get some suggestions!

I tried changing the state of the popup to add 1 to the “number of required questions” every time the multiline input is changed and is not empty and the group within the repeating group’s cell’s custom state was set to empty (this was then set to not empty in the workflow). The condition of the button was: when the popup’s number of required questions is [search for questions:count] → this button is clickable. This seemed to work.

The other way around I tried changing the state of the popup to subtract 1 to the number every time the multiline input is changed and is empty and the group within the repeating group’s cell’s custom state was set to not empty (this was then set to empty in the workflow). Then again the condition of the button was, when the popup’s number of required questions is [search for questions:count] → this button is clickable. However, the subtraction of 1 when the input was ‘emptied’ didn’t work for an unknown reason.

Is there an easier way to do this or am I on the right track?

What would you suggest to do in this case?

Many thanks in advance!!

Bart

1 Like

Hi,
If there is a workflow associated with a button that uses an input, then the button and the input are somehow linked together and the button will be “not clickable” if the input is empty.

Thus, you can use this condition on the button
image

Have literally been working on it for hours yesterday & now 10min after this post I made it work with the WatchInput plugin and the same exact logic as explained in the post :grin:

2 Likes

Didn’t know about this, thanks very much!!

That makes no sense at all…

it will throw the following error, obviously: Recursion when evaluating property button_disabled on element “Button A”

3 Likes

Totally, the “this elements isn’t clickable” on the screenshot is an obsolete remainder from my lab page, it does not belong there.

What’s important to note is the fact that the button is considered “not clickable” by bubble if a ma,ndatory field is not filled. That can be handy as you can easily add some logic in the condition tab without going into endless conditions “if X is empty AND Y is empty AND Z is empty”…

Only if you check the ‘This input should not be empty’ box…

And it doesn’t work for inputs inside RGs (which is what this thread is about).

3 Likes

You’re right, my bad I didn’t take enough into thinking that those inputs were in a repeating group.