Spry

Specify a minimum and maximum number of characters

This option is only available for the "none", "integer", "email", and "url" validation types.

The minChars option does not enforce a minimum number of characters if the text field is not required.

 To specify a minimum or maximum number of characters, add the minChars property or maxChars property (or both) and a value to the constructor, as follows:
<script type="text/javascript">
	var tf1 = new Spry.Widget.ValidationTextField("textfieldwidget1", "validation_type", {minChars:value, maxChars:value});
</script>
Note: If a validation type is not required, you can set the validation type to "none". See Specify a validation type and format.