[CKEditor] CKEditor how to get wordcount

Forge Component
(28)
Published on 26 May (6 days ago) by Prasad Rao
28 votes
Published on 26 May (6 days ago) by Prasad Rao

Hi all, 

I using CKEditor for some report writing and I have to set a minimum word counts for the users. I already enable the wordcount function, but can i get the number of word count out of the editor?

Solution

Hi,

As per article here. By javascript you can get the word count, just replace the <inputfield.Id> with the inputId that you send to ckeditor webblock.

If you want to query the current wordcount you can do it via

// get the word count
CKEDITOR.instances.<inputfield.Id>.wordCount.wordCount 

// get the char count
CKEDITOR.instances.<inputfield.Id>.wordCount.charCount 

Regards.

Solution