[CKEditor] CKEditor how to get wordcount

Forge Component
(29)
Published on 25 Aug by Prasad Rao
29 votes
Published on 25 Aug 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