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?
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”.
2 Likes
Bloody hell, I was way overcomplicating that, thanks!!
1 Like
Certainly! Here’s a translated version of your request in English:
I would like to inquire about implementing a checkbox component with a specific requirement. When the checkbox is unchecked and clicked, I need to add different values each time.
Could you please guide me on how to implement this?