I am using JQTE to implement a WYSIWYG editor. It works great. But I need to be able to limit the number of characters in it to a fixed number , say 3000. This includes the HTML tags that get generated along with the content. I am able to get the count of number of characters in the textarea for which the jqte is applied to, but i'm not able to stop the user from typing any length of characters. I want the editor to not print anything on keypress if it is beyond the 3000 limit. I tried using the change function that comes with the plugin with keypress within it, but did not achieve what I set out to do. I can do a substring of the final text and take only the first 3000 characters, but thats not what i want. Can anybody help me out with this.
Also, I noticed that the change function gets logged 5 times on my Chrome console for every key pressed. This is not related to the above mentioned question. Its just something that I noticed. Is it a bug?
I realize this is an old post, but I ran across it looking for the same answer. Here's what I did and it works well.
I then just added the counter box below the text area. This will prevent any key press, but delete from working after the total character limit is hit.