This solution can be reused for all text areas with a single function and it does not inform the user that he is typing too many characters, this prevents them from doing this, sort of like maxlength
Function:
<script language="javascript" type="text/javascript"> function imposeMaxLength(Object, MaxLen) { return (Object.value.length <= MaxLen); } </script>
Implementation:
<textarea name="myName" onkeypress="return imposeMaxLength(this, 15);" ><textarea>
source share