Good morning dear members of the alt.html newsgroup.
Is there any option to limit the number of characters in a text area
(<textarea> tag) ?
Many thanks.
freeposte
You can try some methods, such as JavaScript, but you should always
ensure you do some checking server-side. Anything too large, either
reject immediately and warn the user, or truncate it to an acceptable
length. There are simply too many methods people could use to bypass
any attempt to put a limit on the characters, so anything you can do
would be only an attempt to make things more user friendly, if their
browser supports whatever you feature impose for that purpose.
So, if you need a limit imposed for more than the visual aspect while
someone fills in the textarea field, be sure the program/script it
submits that data to does the real checking. Also, I'd recommend
against forcing the feature (JavaScript, or whatever) to make people
"able" to submit it, but just to enhance it if they happen to have it
enabled. Same rule as anything and any design for function on a site,
I suppose.