Forum Discussion
How to assign the entry of a text box to a variable?
Dear Heros,
I have been looking through this forum but couldn't find anything which suits my purpose. So here it goes.
In my course I describe different scenarios in a text box. After each scenario the learner gets some questions to answer and also a place for some self-reflection (text entry field).
At the end of the course I want to provide the learner a PDF of the covered content. This PDF shall include:
- Description of the scenario (-> I'm looking for the text in the text box.)
- Maybe answers and solution to the questions.
- Self-reflection out of the text entry field (thanks to you guys, I could achieve that with a javascript :-)
Therefore my current challenge: How do I get to the content of a normal text box. I would like to write that content into a variable, which I can then also use in my JS. I would like to do it with a variable that any text changes only need to be done once and not at several places...
Has anybody an idea how I could achieve that?
Many thanks in advance,
Regards, Fäbu
- NedWhiteleyCommunity Member
Hi Fäbu,
Instead of trying to copy text from a text box into a variable, you could always create the variable at the start and then use that to populate the text box.
In the attached example, I have first created a variable and filled it with the text that I want in the text box and then used it to populate the text box at the top of the slide. I have then used a button to copy the content to a new variable and display it in a new text box at the bottom of the slide.
There is no requirement to add any additional variables to your first one, but I have simply done this to show that you can manipulate or copy your text in whatever way you wish, once you have your initial variable set up. In your case, you would simply need the original variable filled with the text you want to display in your text box at the start and then use that same variable at the end of your course to help create your pdf.
- FabianDebrunnerCommunity Member
Hi Ned,
Many thanks for your response. I had a look at your file. I basically like the idea of creating a variable and then show that variable in a text box. As I will have more than just one sentence in this variable, I miss the opportunity for any kind of formatting like adding a new paragraph. For a new paragraph I would need a new variable and then I would end up with too many variables.
I will put some thoughts into the decision and make some other testing.
Many thanks for your help.
Regards, Fäbu