Spry

Block extra characters

You can prevent your users from entering more than the maximum number of allowed characters in a Validation Text Area widget. For example, if you set the useCharacterMasking option so that a widget can accept no more than 20 characters, the user cannot type more than 20 characters in the text area.

Use this option in conjunction with the maxChars option. For information, see Specify a minimum and maximum number characters.

 To block extra characters, add the useCharacterMasking property to the constructor and set its value to true, as follows:
<script type="text/javascript">
	var ta1 = new Spry.Widget.ValidationTextarea("textareawidget1", maxChars:20, {useCharacterMasking:true});
</script>