Forum Discussion
AprilDrennan-f8
9 months agoCommunity Member
go to new layer when text has been entered in text box
Hi. I have a text box where the user is supposed to enter the number 68, and then I want that specific number to trigger the opening of a new layer without having to enter any other key such as ENTE...
Nedim
Community Member
I think you could use a bit help of Javascript. Something like this:
const textFields = document.querySelectorAll('.acc-textinput');
textFields.forEach((textField) => {
textField.addEventListener('keyup', () => {
textField.blur();
});
});
Put this code in 'Execute Javascript when the timeline starts on this slide' trigger.
The blur() method will remove keyboard focus from the current element. Create a trigger in SL to say: Show layer 'correct' when 'NumericEntry' changes if 'NumericEntry' = value 68. As soon as you type 68 into the input field another layer will show up.
AprilDrennan-f8
9 months agoCommunity Member
I'll give it a try. Thank you!