When going over the character limit of the field in IE8 the counter goes in negative and the characters are not limited to the max amount either.
It seems to only happen for textareas.

Comments

mvwensen’s picture

The 'maxlength' attribute for textarea is since HTML5.
IE8 and 9 ignore them (for input types they seem ok).

I fixed it like this:

In maxlength.js insert after line 106 :

// Fixes IE8 and IE9 textarea function. textarea[maxlength] <= HTML5
if(0 >= available){ 
  obj.val(obj.val().substr(0, limit));
  count = 0;
  available = 0;
}

Feedback is welcome.

Karol Haltenberger’s picture

If you are not using 'Force truncate text' on the field, this overrides that and does truncate anyway.

If you are truncating anyway, you should check 'Force enforce text'.

If you checked it and you still get negative values then you should apply this: http://drupal.org/node/1647114

Karol Haltenberger’s picture

Issue summary: View changes

only for textarea

cedewey’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

We are only maintaining the Drupal 7 version of the module for critical security fixes, so I'm marking this Closed (won't fix). Thank you 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.

I also encourage you, if you haven't already, to upgrade your site to Drupal 8/9. We are actively maintaining that version and you would enjoy all of the other features of the latest version of Drupal.