Option to limit the number of caracters in <textarea> ?

F

freeposte

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
 
M

+mrcakey

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

Only by using JavaScript.

+mrcakey
 
J

Jukka K. Korpela

Good morning dear members of the alt.html newsgroup.

19:00 is an odd time for "good morning".
Is there any option to limit the number of characters in a text area
(<textarea> tag) ?

It depends on what you mean by "option" and "limit" and "is there". But the
interesting question is why you would do this.

I'd suggest starting from
http://www.cs.tut.fi/~jkorpela/forms/textarea.html
which should at least help you to formulate a useful question.

(Within HTML, the answer is of course "No", but you surely knew this - it
was easy to check this from HTML specifications and references, wasn'it it?)
 
F

freeposte

19:00 is an odd time for "good morning".


It depends on what you mean by "option" and "limit" and "is there". But the
interesting question is why you would do this.

I'd suggest starting fromhttp://www.cs.tut.fi/~jkorpela/forms/textarea.html
which should at least help you to formulate a useful question.

(Within HTML, the answer is of course "No", but you surely knew this - it
was easy to check this from HTML specifications and references, wasn'it it?)

That's right. thanks.
 
T

Tim Greer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top