Helping ordinary people create extraordinary websites!

How to limit in real-time the number of characters in textarea with JavaScript?

Thursday, 8th October 2009
by VistaXP

I have a textarea in my form that should allow the user to enter a maximum of 300 characters. I would like to use JavaScript to set this up so that while the user is entering characters into the textarea they are seeing a countdown of how many characters more they are able to add before they hit the limit. Thanks.

More JavaScript Help:
» GetElementById, z-index and onclick - getting the clicked layer on top
» Dynamic fields in: document.getElementById('<%= lstFieldList_TrajectType(0)%>').value
» JavaScript Print
» How to do calculations using JavaScript
» How can I disable my submit button if the textarea in my form is empty?
» What is the difference between synchronous and asynchronous requests?
» How can I control a group of checkboxes with only 1 check?
» How to create an online voting or survey system using JavaScript?

Tell a Friend


Developer Resources