<textarea name="txtbody" style="width:100%;height:320px;" >
{$article.txt}
</textarea> <script charset="utf-8" src="__STATIC__/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="__STATIC__/kindeditor/lang/zh_CN.js"></script> <script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="txtbody"]', {
allowFileManager : true,
//解决JS提交无法获取值
afterBlur: function(){this.sync();} });
});
</script>
如果使用js促发的表弟页面提交,需要加入:
afterBlur: function(){this.sync();}
否则后台无法获取到值。
读取提交结果:
stripslashes($_POST['txtbody'])