Forum Discussion
variables with text entry help
Hi. I am not sure if what I am asking is possible. The user is supposed to type the number 68 into an input box. Once they type that number, I want a red lined shape to appear around another area of the screen , but only if 68 has been typed. I don't want the user to have to click anywhere once the 68 has been typed. As soon as the 8 is typed, the other rectangle shape should appear. Thanks.
- JudithVan-GCommunity Member
Trying some things out after reading your question so might as well send it to you :)
(although I suppose you don't want users to click before entering the digits either...) - Nathan_HilliardCommunity Member
April, Brian's solution will probably do what you want.
However, if anyone wants to trigger something directly from the value you type into an input text box, then you can do something like this. In the example, as you type into the box, the current value is displayed. When it matches the target value that you set, the red box is triggered. No pressing enter or clicking required.
https://360.articulate.com/review/content/35f36820-20f1-4e4e-ab5b-97b9342f490e/review
It uses a small piece of JavaScript to "listen" for changes to the input box's contents. It doesn't need to have them committed before it can respond. The event listener is only active when the input box has focus.
- TanyaStillman-7Community Member
Thanks, Nathan! This solution provided me with exactly what I needed! I just copied your example slide into my story and changed the target value to what I needed. You're fabulous!
- SBP_IncCommunity Member
Triggers do not fire on individual keystrokes, but I was able to get close to your ask. I created a variable called "entered", connect a text input to that variable, then show the "redbox" layer using a Show Layer trigger with conditions [when variable changes; entered == 68] . The layer shows only after ENTER.
- AprilDrennan-f8Community Member
Did you create and upload a file? I don't see it, unless I'm looking in the wrong place. Or am I just following your instructions. In either case, thank you!