Best approach to manipulating/displaying variables
Apr 29, 2020
Hi folks!
Looking for a bit of guidance on the best approach to something.
What I'm trying to do:
User selects from a series of options via Check Box, which updates a text variable that i wish to display later.
I am currently using a trigger to change the 'value' of a text variable from 'blank' to whatever text is used in the check box.
On another slide, i insert the variable reference, and if it was selected previously, it displays, if not, no display. Perfect.
However, the issue i have is that empty (blank) variables take up space where i put the reference, which i don't want. i would love to have only variables with a text value to appear neatly in a list (or something along those lines).
I have attached a test .story file. If you select 1-A and 1-C, then go to the next screen, you'll see what i mean (the '2' side doesn't do anything).
Any thoughts? Is there a better way to accomplish what i'm trying to do?
3 Replies
I think the only way you can do that is with javascript. Here's a sample of what I have done. My result page has lots of extra triggers, because I put the results in fancy boxes, which don't disappear if empty. If I had used plain text boxes for the references, I could have gotten by without all the triggers. The script is on the results slide
Hi Walt,
I had a feeling JS may come into play to accomplish what I wanted. I'll take a look at your sample and go from there.
Thank you!
Walt,
your sample got me to the finish line with my project! Thank you so much!
I have attached my complete, working example...it's a bit different than yours, but accomplishes what i was after. I even figured out the 'toggle' option for triggers, which was a huge improvement over trying to figure out how to reset variables when things are unchecked.
I'm sure there are ways to make the javascript a little more easily scaled, as that's what my actual project will require, but this does exactly what i wanted.
Thanks again!
This discussion is closed. You can start a new discussion or contact Articulate Support.