The CCK text module does not use the "max_length" value defined for a text field if it is a textarea field. So the built-in validation that checks for #maxlength does not get applied.

I added lines in to do this in the text_widget() function - basically just copying the lines that define #maxlength for text fields - and it seems to work. At least, I am getting validation of the maximum length now, and nothing seems to be broken...

I honestly don't know if this is a "feature" - in that, there is a reason for it being this way - so if there is, that would be useful to know (with some words about what that reason might be, of course...)

I'm attaching a patch file to show the changes I made.

CommentFileSizeAuthor
cck.text_.textarea_maxlength.patch1.16 KBbrad.bulger
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KarenS’s picture

Status: Active » Closed (won't fix)

The D5 version is no longer being supported. Sorry.