Page 1 of 1

Input text box limitations

PostPosted: Thu Dec 11, 2014 6:47 pm
by Nav
We recently had the following question:

Is there a way to limit the amount of text a learner types into a input text box? I thought changing the number of lines in the properties would do this but it seems to only affect the size of the box.

Re: Input text box limitations

PostPosted: Thu Dec 11, 2014 6:48 pm
by Nav
There isn't a built in way to do this, but with some clever coding you can get it done.

Basically, the Input Text object doesn't have a property to limit text, and it doesn't have a getLength method. But the Text Variable does. So we can store text into variables as they are typing, and do the calculations based on that.

Here's a video on how to do it - http://screencast.com/t/HZSq6wctFFJz

Not able to open ./cache/data_global.php