广州传奇网络

地址:广州市天河区东圃大马路富华楼C座

电话:13808825895

邮箱:gz020wbs@163.com

QQ:1564443073

网址:http://www.020wbs.com/

首页 > 二次开发Ecshop二次开发 > ecshop获取不到kindeditor中textarea的值

二次开发Ecshop二次开发

二次开发Ecshop二次开发

ecshop获取不到kindeditor中textarea的值

 当我们吧ecshop后台的编辑器换掉的时候,我们可能选择kindeditor编辑器,但是kindeditor编辑器他在很多情况下,是无法获取值textarea的值得。这个是因为kindeditor的编辑器的js在加载的时候,会吧ecshop编辑器中的产品替换掉。这个时候。我们发现ecshop编辑产品的时候,kindeditor编辑器的内容是空的。造成了ecshop产品描述内容为空,获取不到产品描述内容。
其实我们把ecshop的编辑器,修改成这样就OK了
function create_html_editor($input_name, $input_value = '')
{
global $smarty;
$kindeditor="<script charset='utf-8' src='../includes/kindeditor/kindeditor-min.js'></script>
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name=\"$input_name\"]', {
allowFileManager : true,
afterBlur: function(){this.sync();},
width : '700px',
height: '300px',
resizeType: 0 //固定宽高,

});
});
</script>
<textarea id=\"$input_name\" name=\"$input_name\" style='width:700px;height:300px;'>$input_value</textarea>
<input type=\"submit\" value=\"提交\" />
";
$smarty->assign('FCKeditor', $kindeditor); //这里前面的 FCKEditor 不要变
}