Input text box limitations

For general questions about Content Authoring

Moderator: Nav

Input text box limitations

Postby Nav » Thu Dec 11, 2014 6:47 pm

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.
Nav
 
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm

Re: Input text box limitations

Postby Nav » Thu Dec 11, 2014 6:48 pm

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
Nav
 
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Not able to open ./cache/data_global.php