设置单词在tenyMCE中的限制

set the limit of word in tenyMCE

本文关键字:tenyMCE 单词 设置      更新时间:2023-09-26

我在我的网站上使用TinyMCE。通过使用它,管理员可以编辑网站静态页面的数据。一切都很好,但我想知道有没有一种方法可以设置所需的最小字数。我的代码是

 <script type="text/javascript">
tinymce.init({
selector: ".editor",
theme: "modern",
plugins: [
"code advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"save table contextmenu directionality emoticons template paste textcolor"
],
content_css: "css/content.css",
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l      ink image | print preview media fullpage | forecolor backcolor emoticons", 
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
]
}); 
</script>

<form action="#" method="POST" role="form">
<div class="form-group">
<label for="body"> Body: </label>
<textarea class="form-control editor" name="pagedata" id="body" rows="8" placeholder="body">
</textarea>
</div>      
<button type="submit" class="btn btn-default"> Save </button>
</form> 

非常感谢的帮助

在这里找到它:http://www.tinymce.com/wiki.php/TinyMCE3x:How_to_limit_number_of_characters/words

提交时首先进行检查。