tags:

views:

77

answers:

3

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.

+1  A: 

There's no maxlength attribute defined for textarea. You need to implement this using javascript.

Darin Dimitrov
A: 

http://stackoverflow.com/questions/1125482/how-to-impose-maxlength-on-textarea-in-html-javascript

Espen Schulstad
If you find questions that are duplicates - add a comment, and then those of us with sufficient reputation (3,000) to close can close the question as a duplicate!
Dominic Rodger
A: 

please use jquery for reference

<script type="text/javascript">  
$().ready(function(){   

     $("#textareaId").maxLength(20);   

 });
</script>