Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set a max size for textarea input

Status
Not open for further replies.

OhioSteve

MIS
Mar 12, 2002
1,352
US
Hi!

I have an html question. I am creating an area where my users will type several words of text. They should be able to type up to 200 characters. How can I do one of these two things?

EITHER

create an "input text" element with word wrap and multiline capability

OR

create a "textarea" element with a cap of 200 characters

Thanks alot for your help!

PS: I know about the row and column attributes of the textarea element. I tried capping it that way, but that did not prevent me from typing >200 characters.
 
You can't limit the amount of characters in a textarea using pure HTML, you'll have to use Javascript for that, or enforce it server-side when you process the form.

For a Javascript solution ask in the Javascript forum here: forum216.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top