Forum Discussion
KylevonBose
7 years agoCommunity Member
TextEntry field not retaining paragraph breaks in HTML5 publish
Hello:
I have a text entry field that asks the student to enter a list. When they enter their list with paragraph breaks (returns), it looks fine in the text entry field, but when the %textentry% ...
ScottWiley1
7 years agoCommunity Member
Hi Kyle,
While waiting for a more permanent, and easier fix, your idea of separate text entry fields may be the way to go.
Then when you want to display all the text in a single text field later, you could use a JavaScript trigger to combine and display the different variables together while inserting a manual line break or paragraph break between them.
Example:
var listItem1 = player.GetVar("listItem1");
var listItem2 = player.GetVar("listItem2");
var listItem3 = player.GetVar("listItem3");
var listItem4 = player.GetVar("listItem4");
var listItem5 = player.GetVar("listItem5");
var listItem6 = player.GetVar("listItem6");
var listItem7 = player.GetVar("listItem7");
var listItem8 = player.GetVar("listItem8");
var yourList = ""; // will be used to combine them all.
// for a new line use "\n"
// for a new paragraph use "\r\n"
yourList = listItem1 + "\n" + listItem2 + "\n" + listItem3 + "\n" + listItem4 + "\n" + listItem5 + "\n" + listItem6 + "\n" + listItem7 + "\n" + listItem8;
// set the combined text field's variable on the stage to the yourList variable
player.SetVar("yourList",yourList);
Of course you might need to do some looping and checking to see if any of those list item variables are empty, so wouldn't add them to your final list.
Just an idea, but hope it helps.