Evaluate a text entry field WITHOUT clicking out

Jan 03, 2014

Hi all, 

Hoping you can help! I have a text entry field. I want to allow users to type a freeform response that gets evaluated. 

As long as the text entry field contains the words "friendly staff", "branch" and "office", regardless of order or any extra words, I want to mark as correct or progress to the next slide. Also, the user will be pressing the enter key after typing their response  - They shouldn't click anywhere, since this training simulates a text app.  

I can't figure out how to evaluate the text string using Storyline's built-in features, or even using a javascript workaround. The problem is I can't seem to assign the text to a variable unless the text entry field loses its focus. But the user isn't using the mouse for this activity - the expression should be evaluated when they press "enter".  

How would I do this? What am I missing here? 

4 Replies
Josh Uhlig

I suggest duplicating the slide and evaluating the answer on the second slide.  That way, you can trigger the next slide with the press of the enter key.  You can then trigger all the evaluation to happen 'when timeline starts' of the second slide.  You will need to first pass what they type into the text entry to the following slide using an adjust variable (the first trigger 'when timeline starts').

Michael Hinze

Have look at this sample here: http://dev.keypointlearn.com/xcl71_SL/TEBContains/V3/story.html I adapted this from a previous example, so disregard the cellphone-related question. A Javascript is called when the user presses the Enter key. The script checks if any of the keywords are included (from your post I wasn't sure if you wanted to check for ANY of the keywords or ALL). Here is some info on how the Enter key behaves in text entry boxes.

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