编辑时复选框不呈现
Checkbox not rendering when editing
我在我的网站上配置了 CKEditor 4,并且刚刚添加了一个插件(表单),让我可以在我的编辑器中添加复选框。我添加复选框,保存,结果保存到我的数据库中。
但是,当我编辑我的资源时,当 CKEditor 出现时,所有内容都会显示,但复选框没有出现。
我的HTML保存的是这样的:
<p><input type="checkbox"> Testing</p>
我的 CKEditor 配置是:
var ck = CKEDITOR.replace(elm[0], {
forcePasteAsPlainText: true,
toolbar: [
{ name: 'basicstyles', items : ['Bold', 'Italic', 'Strike'] },
{ name: 'links', items : ['Link', 'Unlink'] },
{ name: 'paragraph', items : ['NumberedList', 'BulletedList', 'Checkbox'] }
]
});
ck.config.extraPlugins = 'forms';
有人可以帮助我吗?
仅作记录,此问题的解决方案是在 CKEditor 配置中允许其他内容类型。
ck.config.extraAllowedContent = 'input[type]';
此行使编辑器接受具有类型属性的输入标签。
我在我的网站上配置了 CKEditor 4,并且刚刚添加了一个插件(表单),让我可以在我的编辑器中添加复选框。我添加复选框,保存,结果保存到我的数据库中。
但是,当我编辑我的资源时,当 CKEditor 出现时,所有内容都会显示,但复选框没有出现。
我的HTML保存的是这样的:
<p><input type="checkbox"> Testing</p>
我的 CKEditor 配置是:
var ck = CKEDITOR.replace(elm[0], {
forcePasteAsPlainText: true,
toolbar: [
{ name: 'basicstyles', items : ['Bold', 'Italic', 'Strike'] },
{ name: 'links', items : ['Link', 'Unlink'] },
{ name: 'paragraph', items : ['NumberedList', 'BulletedList', 'Checkbox'] }
]
});
ck.config.extraPlugins = 'forms';
有人可以帮助我吗?
仅作记录,此问题的解决方案是在 CKEditor 配置中允许其他内容类型。
ck.config.extraAllowedContent = 'input[type]';
此行使编辑器接受具有类型属性的输入标签。