Forum Discussion
Using variables to generate organized lists
Hi Brent,
The first slide won't work properly if the user selects a checkbox and then unselects, or clicks a checkbox multiple times, because your triggers are adding 1 every time a checkbox is clicked, whether it's selected or not.
In the attached file, I have re-done the triggers and added a layer to accumulate the selections. The first slide also accommodate users who advance to the next slide but then want to come back and change some of their selections. I won't go through the details here, but if you study the triggers on the layer and base layer, I think you'll understand what I have done.
Next, I added an Execute JavaScript trigger on the last slide in order to accommodate your desire to remove blank lines in the boxes. The sample Walt linked to is much more efficient than my JS code in that he uses a loop. I elected to spell out each line rather than use a loop (or in this case, nested loops) to make it easier for you to understand in case you're unfamiliar with JavaScript. The code seems long but it's really just a handful of lines being repeated over and over again to accommodate the 7 of 9 boxes that could display one or more values.
I'm happy to answer any questions.