Enable Button After Checkbox Changed State


#1

I know how to brute force this, but wondering if there is a way that I can do this more intelligently.

It’s simply a filter that has a disabled button when nothing has changed. What would be the best way to store the “state” of the filters, and do checks each time the filters are interacted with to enable/disable the submit button?. I.e., checkbox 1 on default was selected, If I unselect it, the button would become enabled, if I reselected it, the button would become disabled. If I submit the button when it’s enabled, how do I store that new combination of selections to reenable the button. Hope that makes sense!

Default Prototype:
[X] Checkbox 1
[ ] Checkbox 2
[ ] Checkbox 3
[Disabled Submit Button]

EDIT: Maybe related to this but it does not take into account that a checkbox can be preselected on load. Triggering Different Actions Based on Number of Checkboxes Selected


#2

Probably the easiest way to do this would be to use a repeater: Detect_Check_Change.rp (57.7 KB)

The repeater has a column that stores the “previous” value of the widget and a column that stores the “current” value. Whenever a checkbox is clicked, it updates the current value. Each time the repeater refreshes it compares the current value to the previous value, if they’re not equal then a change was made and the button enables.


#3

@huban I am so sorry it took so long to thank you for this. Amazing help - hope you are well.


#4

No worries. Glad it hear it helped. :grinning: