Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Remaining character count works when in plain "text editor" mode but when in WYSIWYG mode, the count does not change as you type. This issue was also reported in http://drupal.org/node/715374 with FCKeditor.
Comment | File | Size | Author |
---|---|---|---|
#16 | issue-859746.diff | 4.58 KB | thehong |
#15 | issue-859746.diff | 4.51 KB | thehong |
#10 | maxlenght.png | 23.2 KB | soulfroys |
#8 | maxlength+ckeditor_62beta2.patch | 2.8 KB | Anonymous (not verified) |
#5 | maxlength_ckeditor.patch | 3.25 KB | kongoji |
Comments
Comment #1
kiwad CreditAttribution: kiwad commentedSame issue with Wysiwyg/Wymeditor . Works in plain text but doesn't in rich text
Comment #2
botrisStill an issue
Comment #3
muschpusch CreditAttribution: muschpusch commentedsubscribe....
Comment #4
muschpusch CreditAttribution: muschpusch commentedI tried to create a patch so that maxlength will work with ckeditor. Maxlength shouldn't count html so i added strip_tags from php.js and added strip_tags to the count in maxlength.module. Another problem is that my selector for the ckeditor field isn't working correctly.
$('.cke_contents iframe:visible').contents().find('body').html().length;
The selector works for me in the console but not in the maxlength.js. The last step would be defining a condition to switch between the default selector and the ckeditor field.
Someone some ideas about this?
Comment #5
kongoji CreditAttribution: kongoji commentedI extended muschpusch's patch and it should work now with CKEditor, but it needs reviews.
Greetings
Comment #6
kiwad CreditAttribution: kiwad commentedDev version has been updated quite a bit on feb 16th. Patch should be re-rolled
Comment #7
kiwad CreditAttribution: kiwad commentedMarking as a duplicate of this thread : #314508: Doesn't work with WYSIWYG (tinyMCE and CKeditor)
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedIt is not a duplicate, I don't use WYSIWYG module but the CKeditor module.
I made a patch for:
maxlenght 6.x-2.0-beta2
ckeditor 6.x-1.2
Hope it is useful
Comment #9
mErilainen CreditAttribution: mErilainen commentedI couldn't get this to work. It only updates the character count when I turn "Switch to plain text editor". And if I write too long text in plain textareas, then it weirdly removes some of the last characters. Also the validation seems to go crazy, I cannot save the node even when I reduce the amount of characters. And it doesn't seem to count spaces at all when I patch it. Maybe it's because I'm trying to use it on a CCK field?
How should this work anyway in the end? I mean I can define in CCK or Maxlength maximum amount of characters, but that means html included. Naturally when I want to limit the amount of characters, it should be with all html-tags removed, right? Content producers don't need to care about the amount of html underneath, just the visible characters. So Maxlength should somehow override the defined limit when it checks the amount of actual characters without html.
Comment #10
soulfroys@Patrizio, your code works, tks!
But... the copy/paste functionality going crazy (flickers, ghost moves, etc).
Comment #11
held69 CreditAttribution: held69 commentedtried this patch as well.
the count down works well, with regular typing.
However as soon as i copy and paste text, it does not work right.
The counter doesn't work right and i cant seem to remove the pasted text anymore..
Thanks
Comment #12
soulfroys@held69, did you find any solution?
Comment #13
held69 CreditAttribution: held69 commentednope
Comment #14
soulfroysThanks @held69!
Well... I tested the @Patrizio's patch (#8) with the latest CKEditor dev and it worked. But ... with the last maxlenght dev, did not work.
I give up... I love this module, but I can no longer make it work with CKEditor... It's too much bug for my poor skills.
Best Luck to all!
Comment #15
thehong CreditAttribution: thehong commentedMy patch for 6.x-2.x
Comment #16
thehong CreditAttribution: thehong commentedFix js error.
Comment #17
cedeweyThe Drupal 6 version of Maxlength is no longer supported so I'm marking this Closed (won't fix).
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.