[CKEditor] length problem

Forge Component
(26)
Published on 2019-05-08 by Leonardo Fernandes
26 votes
Published on 2019-05-08 by Leonardo Fernandes

i have set 500 character limit. i dont understand why it started giving error after 491 characters and sometimes, when i enter space it start giving error in between. i have set onchange action whenever user enter characters and in that action i set condition by calculating the length i.e if user enter more than 500 it gives error but i dont know why in between it started giving error

Hello Lovish

It may have something to do with html tags that are being used in the backstage. For example, if you are creating links or something that requires an html tag like < a > or < p >,  I think that goes into the character count.

Other possibility is special characters that count for more than one character


Best regards,

Ângelo

Ângelo Sousa wrote:

Hello Lovish

It may have something to do with html tags that are being used in the backstage. For example, if you are creating links or something that requires an html tag like < a > or < p >,  I think that goes into the character count.

Other possibility is special characters that count for more than one character


Best regards,

Ângelo

i want to increase character count for space also. how would i achieve that?


Lovish Goyal wrote:

Ângelo Sousa wrote:

Hello Lovish

It may have something to do with html tags that are being used in the backstage. For example, if you are creating links or something that requires an html tag like < a > or < p >,  I think that goes into the character count.

Other possibility is special characters that count for more than one character


Best regards,

Ângelo

i want to increase character count for space also. how would i achieve that?



Then how to resolve it. What modification i need to do?

Hello Lovish 

You can set the length property on the input's property window


Best regards,

Ângelo

Ângelo Sousa wrote:

Hello Lovish 

You can set the length property on the input's property window


Best regards,

Ângelo

i have set and it is only for max no. of character. But internally it is calculating some extra character 

Hello,

I have the same problem.

In the input i have a Max. Length of 1999 characters,  but with CK Editor they allow me to write all  the character i want.

Any solution about this case ?


Thanks

Filipe Manteigas wrote:

Hello,

I have the same problem.

In the input i have a Max. Length of 1999 characters,  but with CK Editor they allow me to write all  the character i want.

Any solution about this case ?


Thanks

I am having the same issue.

Thanks,

-Edwin


Hi Edwin , i solve it with Javascripit .

If you want to do this with ck editor you have to buy the developer edition .

Best Regards,

FM

Hi Manteigas,

I actually solved it using the config.

New problem though is the label:

I wanted to remove the "Charactars (with HTML): label.



To use the CONFIG, you may use this, the toolbar settings can be changed depending on your need too:


"toolbarGroups : [
        { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
        { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
        { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
        { name: 'forms', groups: [ 'forms' ] },
        { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
        { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
        { name: 'links', groups: [ 'links' ] },
        { name: 'insert', groups: [ 'insert' ] },
        { name: 'styles', groups: [ 'styles' ] },
        { name: 'colors', groups: [ 'colors' ] },
        { name: 'tools', groups: [ 'tools' ] },
        { name: 'others', groups: [ 'others' ] },
        { name: 'about', groups: [ 'about' ] }
    ],

    removeButtons : 'Source,Save,NewPage,Preview,Print,Templates,Find,Replace,SelectAll,Scayt,Form,Checkbox,TextField,Radio,Textarea,Select,Button,ImageButton,HiddenField,CreateDiv,Language,BidiRtl,BidiLtr,Anchor,Flash,HorizontalRule,Smiley,SpecialChar,Iframe,PageBreak,ShowBlocks,About,Superscript,Subscript,Cut,Paste,Copy,PasteText,PasteFromWord',
   

extraPlugins: 'wordcount,notification',

resize_enabled : false,

removePlugins: 'elementspath',

wordcount: {
    // Whether or not you want to show the Paragraphs Count
    showParagraphs: true,

    // Whether or not you want to show the Word Count
    showWordCount: true,

    // Whether or not you want to show the Char Count
    showCharCount: true,

    // Whether or not you want to count Spaces as Chars
    countSpacesAsChars: true,

    // Whether or not to include Html chars in the Char Count
    countHTML: true,
   
    // Maximum allowed Word Count, -1 is default for unlimited
    maxWordCount: -1,

    // Maximum allowed Char Count, -1 is default for unlimited
    maxCharCount: 2000,

   // Option to limit the characters in the Editor, for example 200 in this case.
   charLimit: 2000,
}"



Thanks,

-Edwin




Great Work Edwin!

Thank you !



Edwin Siruma wrote:

Hi Manteigas,

I actually solved it using the config.

New problem though is the label:

I wanted to remove the "Charactars (with HTML): label.



To use the CONFIG, you may use this, the toolbar settings can be changed depending on your need too:


"toolbarGroups : [
        { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
        { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
        { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
        { name: 'forms', groups: [ 'forms' ] },
        { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
        { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
        { name: 'links', groups: [ 'links' ] },
        { name: 'insert', groups: [ 'insert' ] },
        { name: 'styles', groups: [ 'styles' ] },
        { name: 'colors', groups: [ 'colors' ] },
        { name: 'tools', groups: [ 'tools' ] },
        { name: 'others', groups: [ 'others' ] },
        { name: 'about', groups: [ 'about' ] }
    ],

    removeButtons : 'Source,Save,NewPage,Preview,Print,Templates,Find,Replace,SelectAll,Scayt,Form,Checkbox,TextField,Radio,Textarea,Select,Button,ImageButton,HiddenField,CreateDiv,Language,BidiRtl,BidiLtr,Anchor,Flash,HorizontalRule,Smiley,SpecialChar,Iframe,PageBreak,ShowBlocks,About,Superscript,Subscript,Cut,Paste,Copy,PasteText,PasteFromWord',
   

extraPlugins: 'wordcount,notification',

resize_enabled : false,

removePlugins: 'elementspath',

wordcount: {
    // Whether or not you want to show the Paragraphs Count
    showParagraphs: true,

    // Whether or not you want to show the Word Count
    showWordCount: true,

    // Whether or not you want to show the Char Count
    showCharCount: true,

    // Whether or not you want to count Spaces as Chars
    countSpacesAsChars: true,

    // Whether or not to include Html chars in the Char Count
    countHTML: true,
   
    // Maximum allowed Word Count, -1 is default for unlimited
    maxWordCount: -1,

    // Maximum allowed Char Count, -1 is default for unlimited
    maxCharCount: 2000,

   // Option to limit the characters in the Editor, for example 200 in this case.
   charLimit: 2000,
}"



Thanks,

-Edwin