Html 使ckeditor在页面加载时为只读
我想使ckeditor在页面上为只读,并且仅为只读。我该怎么做?我尝试过修改下面的代码来实现这一点,但我似乎无法理解 我让编辑器有一个切换只读模式,它加载为非只读。(这不是我想要的,但这是我得到的最接近的)这是我的代码:Html 使ckeditor在页面加载时为只读,html,ckeditor,readonly,Html,Ckeditor,Readonly,我想使ckeditor在页面上为只读,并且仅为只读。我该怎么做?我尝试过修改下面的代码来实现这一点,但我似乎无法理解 我让编辑器有一个切换只读模式,它加载为非只读。(这不是我想要的,但这是我得到的最接近的)这是我的代码: window.onload = function () { CKEDITOR.replace('textBox', ); } var editor; // The instanceReady event is fired, when an instance of C
window.onload = function () {
CKEDITOR.replace('textBox', );
}
var editor;
// The instanceReady event is fired, when an instance of CKEditor has finished
// its initialization.
CKEDITOR.on('instanceReady', function (ev) {
editor = ev.editor;
// Show this "on" button.
document.getElementById('readOnlyOn').style.display = '';
// Event fired when the readOnly property changes.
editor.on('readOnly', function () {
document.getElementById('readOnlyOn').style.display = this.readOnly ? 'none' : '';
document.getElementById('readOnlyOff').style.display = this.readOnly ? '' : 'none';
});
});
function toggleReadOnly(isReadOnly) {
// Change the read-only state of the editor.
// http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#setReadOnly
editor.setReadOnly(isReadOnly);
}
以及html:
${alert.html}
为
定义禁用的属性,编辑器将启动只读:
<textarea id="editor" disabled>Cow says moo!</textarea>
牛叫哞!
请参阅。为
定义禁用的属性,编辑器将启动只读:
<textarea id="editor" disabled>Cow says moo!</textarea>
牛叫哞!
请参阅。但在发布表单时,它是否可以发布?在普通控件中,如果输入被禁用,则在只读状态下不会提交值,它们将是只读的,但会提交值。但是,当表单发布时,它会发出问题吗?在普通控件中,如果输入被禁用,则在只读状态下不提交值,这些值将为只读,但会提交值。