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.

CommentFileSizeAuthor
#3 maxlength_for_textarea-2492733-3.patch1.04 KBAshlesha
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Cyberwolf’s picture

jhodgdon’s picture

Project: Drupal core » Documentation
Version: 8.0.x-dev »
Component: documentation » API documentation files
Issue tags: +FAPI reference

This file is in the Documentation repository, so moving there.

Ashlesha’s picture

Assigned: Unassigned » Ashlesha
Status: Active » Needs review
FileSize
1.04 KB

Tested #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.

apaderno’s picture

Assigned: Ashlesha » Unassigned
Issue tags: -FAPI reference
apaderno’s picture

Title: maxlength can be applied to textarea as well » Document #maxlength for the textarea form element
Category: Bug report » Task
apaderno’s picture

Status: Needs review » Reviewed & tested by the community

The patch still applies and it changes the developer/topics/forms_api_reference.html file as expected.

apaderno’s picture

Issue tags: +FAPI reference