Question: I want to set maximum length to the textarea. I am using following code for the same,but it is not working,
<textarea name="txtDescription" cols=10 rows=3 maxlength=50></textarea>
But it is not working,it takes characters beyond 50.
This solution is re-usable for all text areas via one function and
it doesn't inform the user that he/she is typing too many characters, it prevents them from doing so, sort of like maxlength
The Function:
<script language="javascript" type="text/javascript"> <!-- function imposeMaxLength(Object, MaxLen) { return (Object.value.length <= MaxLen); } --> </script>