For text entry, is there a way (maybe with Javascript) to make a user enter a minimum number of characters before they can move on? To prevent them from typing in one character just to click next.
V Raja's solution requires jQuery. Any Javascript code you see with $ signs in it are using jQuery. And as jQuery is not included anymore in Storyline it wont work as is.
Hello Matthew, I wanted to ask if there is already an option to bypass saving the text in a variable, so that I don't have to click outside and can count characters directly as I type?
The short answer is no. A more difficult option might be to capture individual keystrokes and use JS to build up the text. I imagine that would take more work and triggers than it would be worth.
8 Replies
For Text Area:
$('textarea').attr("maxlength",10)
For Input:
$('input').attr("maxlength",10)
This is for Set Maximum Characters Length.
Hi, could you provide an example of how to set the maximum character length? I am having a tough time figuring this out.
Hello, how can I apply this? I've been trying this code by Execute Javascript trigger when timeline starts, but it's not working.
Hello, how can I apply this? I've been trying this code by Execute Javascript trigger when timeline starts, but it's not working.
V Raja's solution requires jQuery. Any Javascript code you see with $ signs in it are using jQuery. And as jQuery is not included anymore in Storyline it wont work as is.
To convert jQuery code to Vanilla Javascript ( Vanilla as it doesnot require any 3rd party libraries like jQuery ) you can use this link.
https://tobiasahlin.com/blog/move-from-jquery-to-vanilla-javascript/
This post was removed by the author
Hello Matthew,
I wanted to ask if there is already an option to bypass saving the text in a variable, so that I don't have to click outside and can count characters directly as I type?
The short answer is no. A more difficult option might be to capture individual keystrokes and use JS to build up the text. I imagine that would take more work and triggers than it would be worth.