[thelist] textarea max character

Mark Groen mark at markgroen.com
Wed Jun 5 09:57:11 CDT 2002


> How does one set the maximum character length/number for <textarea> ?
>
It's a bit more complicated than simply adding maxlength="30" to your
<textarea> string and invlolves some javascript and an .htc file. A good
explanation can be found at:
http://www.siteexperts.com/ie5/htc/ts08/page1.asp
Basically you need to check the length of the textarea before submitting the
form or check the length every time the textarea is changed. Another
javascript solution that also tells the form user how many characters are left
can be had at:
http://www.smartwebby.com/DHTML/textbox_characters_counter.asp as well
as this version which I think is a little better at (URL
wraps):http://webdeveloper.earthweb.com/webjs/item/0,,12755_74001_viewit
,00.html

HTH!



More information about the thelist mailing list