countdown message appears with !remaining but the number doesn't count down
tomotomo - October 28, 2009 - 21:09
| Project: | Maxlength |
| Version: | 6.x-2.0-beta1 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
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.

#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 ?