Sometimes the max length is a warning, but the editor can decide to go over by a few (or man) characters. This is not an option, because maxlength uses the maxlength attribute, which means something in HTML5. There's no easy alter or aything to make this work with maxlength, so I've had to copy a bulk of the code a few times, which is annoying.

If this is a per-field option (default disabled), it can use another attribute, like data-maxlength and check that to show a warning instead of an error.

Related issue #651506: Warning rather than Truncate is similar, but 5 years old.

Comments

amazingrando’s picture

I would like to second this feature request.

I'd love to see a warning character limit and a maxlength.

rudiedirkx’s picture

Maxlength now has a "bypass maxlength" permission, which is related, but not good. Everyone with this permission (so always user 1) won't even see the maxlength widget part. No counting, no warning. Can't disable it. Maybe the permission could do what this issue is about: bypass = don't stop, only warn.

rudiedirkx’s picture

jenlampton’s picture

Status: Active » Needs review
StatusFileSize
new6.82 KB

The attached patch changes the behavior of the `bypass maxlength` permission. Instead of hiding the information, it changes the error into a warning, but allows form submission to proceed as usual.

cedewey’s picture

Status: Needs review » Closed (won't fix)

We are putting a feature freeze on the Drupal 7 version of the module, so I'm marking this Closed, won't fix. Thank you everyone for working on this issue. If you do want to maintain the Drupal 7 version, do reach out. We'd be happy to bring you on board as a maintainer.