Forum OpenACS Q&A: ad_form character size limit for text area widget?

does anybody know whether the ad_form implicitly sets a character limit on text area widgets?

Underneath is an example of a form:

# We build a list of all possible widgets for the form
set all_widgets {
  {title:text {label "Title*"} {html {size 50}}}
  {title:text {label "Name*"} {html {size 50}}}
  {expiry_date:date {label "Expiry Date"}}
  {countries:text(multiselect),multiple {label "Geographic Reference"} {options {$country_opt}} {value {N/A}} {html {size 4}}}
  {from_date:date {label "Starting Date"}}
  {from_date:date {label "Publication Date"}}
  {to_date:date {label "Ending Date"}}
  {content:text(textarea) {label "Actual [string totitle $pretty_document_type] Content*<BR><FONT SIZE=-2><I>(not required)</I></FONT>"} {value { }} {html {rows 30 cols 50}}}

On submit it happens that some content in the text-area field gets cut-off. I have the suspicion that the editor might use malicious HTML tags.

Any idea?


Posted by Ola Hansson on
Hi Gregor,

No it does not set a character length limit on any text types, and I don't think the form builder does either.

As I'm sure you are aware, TEXTAREA has no maxlength but it can be implemented in ad_form via a validation block...

-validate {
         {[string length $content] <= 1000}
         "\"content\" can maximum be 1000 characters long"
...for example should do the trick.

Sorry, I have no clue about the "cutting off" part.


I think the users are most probably using malicious HTML tags that force the text to be cut off. Another indication is probably as this phenomenon does not always occur.

thanxs for the reply!


Posted by Jeff Davis on
You should also check that you are doing a POST rather than
a GET for the form submission since GET can be limited to as
short as 4k in some browsers.
Posted by James Thornton on
In the past, textarea widgets have had max size of 33K, but I think that limit may have changed in modern browsers. If you are using the POST method and you are having problems, this may be the reason. If you are using GET, try using POST.
Posted by C. R. Oldham on
On a semi-related note we have discovered arbitrary limits in the size of listboxes in earlier versions of Netscape on the Macintosh.  I don't know if those had been resolved in later versions of the Mac System or in MacOS X (it was clearly a Mac Toolbox issue).
many thanxs for the tips! The form method is POST, so this should be o.k. I will investigate further. If I find out I'll let you know.


in respect to this thread I found that entry