Acive text entry character limit using Javascript

Sep 11, 2012

Hi,

I've been playing around with Articulate Storyline trial version for the past few days, and I've found it to be a fantastic product. That being said, I've run into a problem with text entry boxes.

My goal is to limit the amount of characters that can be put into a text entry, and so far I've been able use the Javascript "subscript" function to get a limit on characters based on Storyline triggers such as when "control loses focus" or "on click". However,  I have not been able to limit the characters while the participant is actively filling out the form.

For example, a participant tries to type "catttttttttt", but since I've set a character limit of 3, I want to make it so that every time they try to type in that extra "t", the user will only see "catt" for a brief moment (or optimally not at all) before the script shortens the input text back to the correct "cat".

I used this resource as the basis of my code : http://javascript.about.com/library/bltxtmax2.htm

I am hoping that someone might be able to explain to me how to use an onkey type function to accomplish this, Since that's what I was intending to use when I first created this script.

Thank you!

Binet Lee

3 Replies

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