Posted by tomotomo on October 28, 2009 at 9:09pm
Jump to:
| Project: | Maxlength |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I have maxlength configured for a CCK field and the countdown message appears with !remaining correctly substituted when the page loads. However as I type in the textarea nothing happens, the number doesn't count down.
Comments
#1
It looks like the IDs are screwed up. E.g. the id for the textarea is edit-field-filerequirements-0-value-1 whereas Drupal.settings.maxlength has edit-field-filerequirements-0-value -- so the actual ID has an extra "-1" appended to it, although I don't understand why.
So if I hack the code in maxlength.js around line 30:
var element = $("#"+ id+'-1');
Then at least the correct element is set with the keyup event. But when Drupal.maxLength_limit is called, the field doesn't have an attribute "limit". What should this look like?
And finally, even if I hack the code to set the limit manually, the following line still doesn't update the HTML:
$('#maxlength-'+field.attr('id').substr(5) + ' span.maxlength-counter-remaining').html(remainingCnt.toString());
Can anyone tell me what's going on inside maxlength.js ?
#2
Subscribing. Isn't anybody else experiencing this problem with CCK text area and text field?
#3
This issue seems to be fixed in 6.x-2.x-dev 2010-Jul-11, at least with
a single CCK field (see also http://drupal.org/node/858614)
#4
Patch at http://drupal.org/node/808598#comment-3119850 fixes this issue for me. Any hope of a non-beta release soon?
#5
Automatically closed -- issue fixed for 2 weeks with no activity.