Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API page: https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...
According to the current documentation, #maxlength is only applicable to password and textfield elements, and in addition machine_name (see table on top of the documentation page). textarea should be added as applicable element, because it seems to work properly as well on it.
Comment | File | Size | Author |
---|---|---|---|
#3 | maxlength_for_textarea-2492733-3.patch | 1.04 KB | Ashlesha |
Comments
Comment #1
Cyberwolf CreditAttribution: Cyberwolf at 2DotsTwice bvba commentedComment #2
jhodgdonThis file is in the Documentation repository, so moving there.
Comment #3
Ashlesha CreditAttribution: Ashlesha commentedTested #maxlength for textarea and updated the documentation for the same.
Attached the patch here.
#maxlength on textarea throws an error on form submission if the entered characters are greater than the specified limit in #maxlength.
Comment #4
apadernoComment #5
apadernoComment #6
apadernoThe patch still applies and it changes the developer/topics/forms_api_reference.html file as expected.
Comment #7
apaderno