View Full Version : Limiting the number of characters for TextField
skanumuru
11 May 2009, 5:28 PM
How to limit the number of characters for the TextField component? I tried to do it with setMaxLength(), but this does not limit to the specified length.
Thanks,
catacaustic
11 May 2009, 10:40 PM
setMaxLength() will limit the amount of characters that is allowed in the field, but it doesn't actively check to see how long the text is as the user is typing. To be able to do that, you'll have to set up a listener on the field that checks how many characters are in there after every keystroke.
Martin.Trummer
12 May 2009, 12:25 AM
there's a smarter way of doing this:
http://extjs.com/forum/showthread.php?t=50418&highlight=maxLength
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.