When using textarea elements in forms it's possible to insert an arbitrary amount of text. If not caught in the validation hook this usually leads to PDO exeptions when the data is inserted in the DB.

In consistency with the textfield I request a maxlength attribute for this form element.

CommentFileSizeAuthor
#1 2226497-textarea-maxlength.patch1.71 KBDave Reid
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Title: form elements of type textarea should be able to set a maxlength » Add support for #maxlength on textarea form elements
Status: Active » Needs review
FileSize
1.71 KB

Having a maxlength property is totally valid HTML5: http://www.w3schools.com/tags/att_textarea_maxlength.asp. I agree it should be supported. Even though IE 8 and 9 don't support it, adding FAPI support for #maxlength would mean it still gets validated server-side.

matthias_mo’s picture

much appreciated, thank you very much!

youngwolf0’s picture

This has been sitting for 4 years, is there anything I can do to help get this pushed into core?