Characters count in summernote wysiwyg

Share on facebook
Share on twitter
Share on linkedin

Summernote is great and free wysiwyg editor that offers basically everything that paid wysiwyg does, however when I got to the point where I need real time characters count and limiter, I haven’t found that option so Im providing you with workaround for it.

First step would be to add count span, that you can position wherever you want:

And before calling summernote,  set char limit:

Let’s assume that you are calling summernote on textarea with id “textarea”, and it’s waiting for parameters, and one of them is is callbacks, so here’s what it needs to contain:

 

It will prevent any kind of input or trim if visitor pasted text, based on limit.

Subscribe to our newsletter

Be first to read new helpful post

Share this post with your friends

Share on linkedin
Share on xing
Share on twitter
Share on facebook

Communian – GO LIVE

In one of our previous blog posts we have announced Communian – an event platform for local communities, that will allow you to find interesting

Communian – COMING SOON

Update: We have launched communian.com on 19th November and we would like to invite you to check it out by registering. Find local communities of your

Leave a Reply

avatar
  Subscribe  
Notify of