开发者

Character limit in TinyMCE is not working

开发者 https://www.devze.com 2023-01-27 01:20 出处:网络
i have implemented character limit from http://sourceforge.net/tracker/?func=add&group_id=103281&atid=738747

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

i have given maxlength of 10 chars.w开发者_如何学Gohen 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.


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+
}
0

精彩评论

暂无评论...
验证码 换一张
取 消