如何在CK编辑器上创建不可编辑的字段? [英] How can I create uneditable fields on CK Editor?

查看:133
本文介绍了如何在CK编辑器上创建不可编辑的字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,管理员可以更改表单模板,用户应使用CK编辑器或其他编辑器来填写此表单中的空白。但是,当我向用户显示表单时,他们可以删除一些字段。我不想。如何在CK编辑器上创建无法编辑的字段,或者您可以为此建议其他编辑器?

In my app, admins can change form template and users should fill in the blanks in this form using CK Editor or other editors. But when I show form to user, they can remove some fields. I dont wanna this. How can I create "uneditable" fields on CK Editor or can you suggest another editors for that?

预先感谢。.

推荐答案

@Baki,编辑器内容区域是一个开放空间,您可以在其中键入和删除任何内容,从而使删除变得十分困难,即使不是不可能的话。

@Baki, editor content area is an open space where you can type and remove anything what makes deletion preventing pretty hard if not impossible. There is a large amount of cases to handle.

如果您有一些表单字段,希望某些字段可编辑,而有些字段则不可编辑,请四处走动。与其尝试在编辑器中执行此操作,不如将编辑器仅用于可食用字段。表单可以是标准的不可编辑HTML页面,在该页面上具有可编辑部分,可在其中创建编辑器。此类页面的示例如下所示:

If you have form fields that you wish some to be editable and some not, please "go around". instead of trying to do this inside the editor, use the editor only for edible fields. Your form can be a standard non-editable HTML page where you have editable parts on which you can create the editor. Example of such a page could look like so:

<div class="container">
   <h1><p>Hello </p><p contenteditable="true">[NAME]</p>,</h1>
   <div class="text">
     <p>I'm pleased to inform you the total sales has reached<p>
     <p contenteditable="true">[AMMOUNT]</p>
     <p>units...</p>
  </div>
</div>

工作代码如下: https://jsfiddle.net/zqmLLjfh/3/

这篇关于如何在CK编辑器上创建不可编辑的字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆