最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
解决textarea得不到KindEditor编辑器值的方法
时间:2015-10-17 编辑:简简单单 来源:一聚教程网
首先描述下我这边KindEditor的错误现象:
1、在IE8/FF下均得不到值;
2、当点击KindEditor的全拼按钮切换到全屏模式输入时,再返回正常模式,可以得到值;
3、我用的是jQuery的点击事件提交表单的,提交,无法得到值;
4、直接用表单的提交按钮可以得到值。
开始使用方法:
KindEditor.create('textarea[id="fieldContent1"]',{
items : ['source', '|', 'fullscreen', 'undo', 'redo', 'cut', 'copy', 'paste', '|',
'fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link', '|', 'about']
});
结果提交表单的时候textarea没有获取到KindEditor文本编辑器的值
解决办法如下:
KindEditor.create('textarea[id="fieldContent1"]',{
items : ['source', '|', 'fullscreen', 'undo', 'redo', 'cut', 'copy', 'paste', '|',
'fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link', '|', 'about'],
syncType:"form",
afterCreate : function() {
var self = this;
self.sync();
},
afterChange : function() {
var self = this;
self.sync();
},
afterBlur : function() {
var self = this;
self.sync();
}
});
官方解释:
sync()
将编辑器的内容设置到原来的textarea控件里。
参数: 无
返回: KEditor
相关文章
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31
- html area标签解读 10-31
- html使用表单标签实现注册页面代码展示 10-31
- 使用HTML截图并保存为本地图片的代码展示 10-31