Insert the text in the text entry box using jquery

Jun 14, 2020

Hi,

I want to insert the text in the text entry box using jquery not by typing manually in the text entry box.
I want when my timeline starts, jquery automatically run and add the text in the text entry box and show it in the next slide where I have assign the reference tag.

I have also attached the file. Any suggestions to solve this problem?

Please help!

4 Replies
Matthew Bibby

You don't need jQuery to do this. Here are a few ways you could approach it:

  1. Give the variable a default value (i.e. the text you want to appear in the text entry box) that way the text will appear automatically
  2. Add a trigger that assigns the text to the variable (e.g. on timeline start, assign Text Entry 1 with the text "hello"), you can use this approach if you want the text entry field blank initially with the text change triggered later (either time based or action based)
  3. Only if the above options don't help... you can use JavaScript to push the value to the variable from outside of Storyline. It's as simple as putting something like this in an Execute Javascript trigger:
var player = GetPlayer();
var jsVariable = "This is the text that will be pushed to Storyline";
player.SetVar("Text Entry 1",jsVariable);

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