Character limit in TinyMCE is not working

醉酒当歌 提交于 2019-12-11 07:29:13

问题


i have implemented character limit from http://sourceforge.net/tracker/?func=add&group_id=103281&atid=738747

i have given maxlength of 10 chars.when i am going to insert 11 char its inserting blank space. as i have also implemented how many chars are inserted. so it showing 11 chars in statusbar of TinyMCE.

please provide some solution for this or any alternate solution for character limit in TinyMCE.


回答1:


You could write your own plugin and check for onkey events and paste.

Then you could use

var text_content = $(ed.getBody()).text();

// you are looking for text_content.length

if (text_content.length > 10){
  // remove the characters 10+
}


来源:https://stackoverflow.com/questions/4255076/character-limit-in-tinymce-is-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!