Forum Discussion
Press Any Key Trigger
I am trying to build a slide where the learners have to type something in several different text boxes before being able to progress to the next part of the course. As they are all short, I would rather not spread them out over multiple slides if I can avoid it. My thought was that I would make a true/false variable for each box that would change from false to true when they type in the box and then when all the variable equal true, the submit button would allow them to progress. The trouble I'm having is making a trigger that forces the learners to write something in the box to make the variable change. I have done this before where I literally made a trigger for each letter of the alphabet, but that is super tedious. Is there a way to create a trigger that will change the variable if the learner presses any key?
- JudyNolletSuper Hero
When you insert a text-entry field, Storyline automatically creates a variable to store the entry. However, the variable's value isn't updated until the field loses focus.
Because the user has to click something to update the last entry, I think the easiest way to require the user to enter something in every field is to have your Submit button available right away. But add conditions to its trigger so it will only proceed if all the text-entry variables have content. In other words, none can be blank. For just two text-entry fields, that trigger would look something like this:
This trigger shows a Warning layer if any of the fields = blank.
This approach is demonstrated in the attached file.
- AdrianeWolfeCommunity Member
Oh that makes so much more sense! I didn't realize I could change the = in the trigger. Thanks!
- GarthYorko-TECommunity Member
The text input boxes come with their own variable. They automatically update the variable with the typed text when it loses forces (user clicks somewhere else). Use that to trigger moving to the next slide. Add a submit or other button that advances the slide only if the text box variables are NOT EQUAL to blank.
So my trigger on the Submit button is:Jump to next slide when the user clicks the submit button
IF:
Variable Text Box is not equal to blank
AND Variable Text Box 1 is not equal to blank
AND Variable Text Box 2 is not equal to blank
ELSE
Show Layer 1
Layer 1 prompts the user to behave correctly.See the attached file.
- SheriDenningCommunity Member
This is helpful to me also. One further question -- how do you prevent the user from pressing the space bar only and Storyline allowing it as text and allowing them to Submit?
- GarthYorko-TECommunity Member
Never underestimate the ingenuity of users to bypass our best attempts to train them. While we can lead them along the path to enlightenment, they must follow it on their own.
That being said, use these conditions for the Jump to next slide trigger on the Submit button:
Jump to next slide when the user clicks the submit button
IF:
Variable Text Box is not equal to blank
AND Variable Text Box 1 is not equal to blank
AND Variable Text Box 2 is not equal to blank
AND Variable Text Box is not equal to space
AND Variable Text Box 1 is not equal to space
AND Variable Text Box 2 is not equal to space
ELSE
Show Layer 1Then I added this trigger and show a second layer:
Show Layer 2 when the user clicks the Submit button
IF:
Variable Text Box is not equal to space
AND Variable Text Box 1 is not equal to space
AND Variable Text Box 2 is not equal to spaceThen I added another trigger to reset each text box variable to blank:
Adjust variable Text box = blank when the learner clicks the Submit button
IF:
Text box = space(Repeat it for each text box variable. This resets the text box to its initial state)
The word space in the conditions above need to be replaced in the condition by typing the space bar 1 time. See attached.
You can continue to add conditions until you have completely exhausted all possibilities to skip the activity, or just hope that your learners, for the most part, will participate in their training.