163
Views
1
Comments
Solved
[CKEditor] CKEditor how to get wordcount 
Question
ckeditor
Web icon
Forge asset by CKEditor Team

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?

UserImage.jpg
Prasad Rao
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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.