Toggle Checkboxes with counts
I have a form with several panels like below, each panel may have a several sections of checklists.I have left the checklist names in for understanding of the challenge. A user will check a box as they progress through a process. I have a quantity field in the form that will provide the number of checked checkboxes at the end of the process. I have created code that will (once a person checks a checkbox), will add to the count of checked boxes, but the challenge is that it will not decrement if it is unchecked again. Does there exist code to take care of such a situation? I have written simple "for" loop and counter to do the simple checkbox number increment which works... just looking for real time count for increment and decrement. So below for Determine Quality of Food, increment the count if checked, but decrement again if unchecked. TIA
-
Official comment
This can be done with a simple rule like this:
Checked.value = Checkbox1.value.length + Checkbox2.value.length + Checkbox3.value.length;
and the form will automatically increment and decrement in real time based on the number of checked items, like this:
-
Thank you! I will give it a whirl!!! :)
0 -
Ok, I was over thinking it... plus it explain how the engine works... each time there is an event, things are recalculated. I was thinking that i needed a decrement built in... but it just runs a rule... Thank you! Worked like a charm :)
0 -
Glad that helped!
0
Please sign in to leave a comment.
Comments
4 comments