I have a total and I have a list of numbers. If I click a check box next to the number, I want to add this to the total.
I can do this with variables, but if I click the checkbox again it keeps adding to the total.
How can I set it so that when I uncheck the checkbox the number is subtracted from the total?
Solved
Click checkbox to add, uncheck checkbox to minus
Best answer by Edwart
You can achieve this by creating a checkbox component and add the logic to this component. When the checkbox is unchecked and it gets clicked, you add one to the count and change the variant to “checked”.
On this variant add the following behaviour: when the checked checkbox is clicked, subtract one from count and change the variant to “unchecked”.
This topic has been closed for comments
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.