Limit the number of character in tinyMCE

后端 未结 16 1134
心在旅途
心在旅途 2020-11-29 07:44

Im using tinyMCe for my project.Everything is working fine but now i want to restrict the number of character that will be insert into tinyMce text

16条回答
  •  一整个雨季
    2020-11-29 08:16

    Just to improve a little bit the good example given by Vladimir Miroshnichenko, to get a more accurate count, mainly for languages with accented characters.

    I also inlcude the Javascript SpellChecker as the tinyMCE's one (4.1) cannot be used anymore. So the ed.addButton() will include a button in the toolbar to call $Spelling.SpellCheckInWindow('editors'). That perfectly works with tinyMCE 4.1.7.

    I also added a count of words, if you prefer to trig the alarm on word instead of characters.

    
    
    
    Characters left:
提交回复
热议问题