aspose file tools*
The moose likes Struts and the fly likes Limit the length of textarea in struts. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Limit the length of textarea in struts." Watch "Limit the length of textarea in struts." New topic
Author

Limit the length of textarea in struts.

Varsha Patil
Greenhorn

Joined: Jun 16, 2006
Posts: 19
Does anyone know how to set the maxlength for a textarea. I have a requirement where in the User should not be allowed to enter more than 1000 characters in a textarea.

I tried setting maxlength=1000, but then its not working.

Thanks in advance
dongfang wang
Greenhorn

Joined: Jun 21, 2006
Posts: 1
It seems not able to set this property,

also in HTML tag "textarea"
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I don't believe you can set a maximum length on a text area. One possible work-around would be to use JavaScript to check the size of the data in the text area when the fom is submitted and then issue an error message if it exceeds 1000.


Merrill
Consultant, Sima Solutions
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

"Varsha G A",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Varsha Patil
Greenhorn

Joined: Jun 16, 2006
Posts: 19
I have changed the display name as per the naming policy.

Thanks,
Varsha
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Limit the length of textarea in struts.
 
Similar Threads
jsp-tag inside html not working???
Javascript doesn't work in Mozilla
javascript:Restricting the user to paste in textbox
text area character limit code without trimming
Maxlength for textarea not being set properly