Text entry containing a certain word - Trigger

May 14, 2023

Hi there, 

I would like to trigger a slide to lightbox in Storyline when a text entry box contains a certain word, or certain words. I'm struggling to do this with Javascript and conditions, can anybody suggest how I may get this working please? 

Many thanks

8 Replies
Jose Tansengco

Hello Kelsey, 

Looks like a Freeform Text Entry question is what you need! Using this slide, you'll be able to specify all of the correct words that a learner can enter to trigger a correct response.

Note that this will only work for one word, so if you need more than one word to show a layer, you can just design a custom slide that makes use of multiple text entry inputs. I've attached a sample so you can see an example of a slide that makes use of multiple inputs to show a correct layer. 

Steven Benassi

Hi Holly!

It sounds like you were interested in adding filters to text entry fields that would detect if the text has a space or special character.

I see that you've opened a support case and connected with my teammate Dexter. Great move! It looks like Dexter replied to you sharing some feedback on how this would only be achievable through some custom Javascript coding.

I would defer this question to our knowledgeable community members who may be able to share some insight or suggestions!

John Cooper

HI Holly

Many thanks for your question - I am in the process of writing some short training modules on how to use JavaScript in Storyline for my website - I was just writing the section on "Why do we need JavaScript?" - and one reason is to manipulate strings and I was looking for a short example of where this might be useful... and then I spotted your question - perfect!

So I quickly dashed out a quick demo - which you can find here...

https://demo15.profilelearning.com

If this is the code you are looking for, I will tidy it up and publish the JavaScript code here.