[英]Can we put a limit for characters entered through CKeditor
I like to put a limit on character entered using ckeditor. 我想限制使用ckeditor输入的字符。 I used javascript to limit characters for textarea, But i am unable to limit character when ckeditor is used.i want only 3500 words to be entered using ckeditor afterwards a pop up should say i have reached the maximum limit,Is there any way of doing this???
我使用javascript限制了textarea的字符,但是使用ckeditor时我无法限制字符。我只想使用ckeditor输入3500个字,然后弹出窗口应该说我已经达到了最大限制,有什么办法吗这个??? If ckeditor does'nt support this functionality , can someone refer any other editor please.
如果ckeditor不支持此功能,请有人可以参考其他任何编辑器。
You can simply truncate the string returned to the PHP script with substr (). 您可以使用substr()截断返回到PHP脚本的字符串。 If you need to truncate to a word count, then http://www.lullabot.com/articles/trim-a-string-to-a-given-word-count might be a good starting point (though it could use some refinement).
如果您需要截断字数,那么http://www.lullabot.com/articles/trim-a-string-to-a-given-word-count可能是一个不错的起点(尽管它可以使用一些细化)。
Doing it client-side would require a javascript plugin for the editor. 在客户端进行此操作需要编辑器使用JavaScript插件。 If this is the case then this isn't really a PHP question but a javascript question.
如果是这种情况,那么这实际上不是PHP问题,而是JavaScript问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.