Special Characters in Text Variable

Jul 23, 2012


Just as an exercise, I decided to create an on-screen keypad and keyboard and output the text to a variable.   I wanted to make it work just like a text entry box.  In order to make it work, I had to use javascript to edit the variable, but I ran into an issue with certain characters.  Specifically "<" and " " " (double quote).  Anyone have an idea on how to allow these characters in the text variable (and in javascript) and display them properly?  I've attached the .story file for anyone to play.  Feel free to use it in any projects you wish as well.


5 Replies
Emily Ruby

Hi Katrin,

I might be missing something, but I did not see the variable referenced on the results slide. I did add in a variable reference, and when you select either option 1 or 2 with the " in them, the reference is showing correctly with with " in them on the results slide. See attached. Also, this slide is not set up as a quiz slide, so I did notice the Retry function is not working. You can retry the slide, but the answer in the reference will show up as the first selection.

I also converted this to a freeform, just for an idea, and also added a text reference for the variable, and the " showed up.

Emily Ruby

Hi Katrin,

Thanks for the information. The text size may change in the variable reference, however the fonts should remain the same. as long as your are using built in fonts, and you can adjust the size of the text box to avoid this.

Since you are using the text box from hidden to normal, you would not need to worry about what the variable text is. You could set it to something as simple as one letter or number. You would only need to make the variable = the exact phrase if you plan to use it in a reference. I updated your file to have the variable set to Choice1, Choice2, and Choice3, and the text boxes all changed as designed on the results page. However I did notice that the text in some of the boxes does fall off the bottom of the page. I also attached a file using the Variable reference, and the font does stay the same.

Also I added a file using the variable reference with the " added just to take a look at the font display.

This discussion is closed. You can start a new discussion or contact Articulate Support.