Im working on a project where i need to get the text of a specific textfield onscreen in Lectora, and do stuff with it.
First step for me is getting the proper clean text.
And there an issue turns up. An issue with the formatting of text. Whenever a newline is entered in a Lectora textfield, it creates a span for it. So my single textfield in Lectora ends up in 5 spans with text. When getting the text with either JQuery .text(), innerText or Mike Wilcox amazing script getPlainText ( http://clubajax.org/plain-text-vs-innertext-vs-textcontent/ ) i get extra line breaks for each span, thus making my formatting in the Canvas looking off.
So does anyone has a good solution to get the text of a Lectora textfield without having to deal with the spans ??
Don’t you love it when you can answer you own question?
Quick question. What kind of text box are you using to grab text from? Because if you use an Entry Field box from the Test & Survey menu, it creates a variable with the text so that you don’t have to take the straight text from the box. Like if I go in there now and create an entry box, it creates a variable named Entry_0001. If you grab the text from that variable I don’t think it will have the spans in it.