The moose likes Struts and the fly likes Setting maxsize in textareas? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Setting maxsize in textareas?" Watch "Setting maxsize in textareas?" New topic

Setting maxsize in textareas?

Leandro Melo
Ranch Hand

Joined: Mar 27, 2004
Posts: 401
How do i set a maxsize for text areas with Struts tags?
I looked in the documentation and there's no such tag like maxsize, maxlenght as there's one for inputs.

Leandro Melo
SCJP 1.4, SCWCD 1.4
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

This is a limitation of html, not Struts.

A good workman is known by his tools.
Nitin Shivaram
Ranch Hand

Joined: Jan 17, 2001
Posts: 71
You can however put a Javascript check to limit the size of the textarea.

Nitin S<br />Sun Certified Java Programmer for the Java 2 platform.<br />Tekmetrics Certified Java Programmer For the Java 2 Platform.
Tim West
Ranch Hand

Joined: Mar 15, 2004
Posts: 539
For such a simple and seemingly standard task, I have found this to be very difficult. I've written a workable solution that is (I think) IE-specific, which I hate.

In any case, I'm happy to share it if people want. Does anyone have a solution they consider remotely elegant? Mine is most certainly not.


PS we might get better answers in the HTML forum...
I agree. Here's the link:
subject: Setting maxsize in textareas?
jQuery in Action, 3rd edition