javascript - Disabling CKEditor, Re-enabling with JS - Stack Overflow

I have the following:POST page that allows users to write text in CKEditorVIEW Page, that views the t

I have the following: POST page that allows users to write text in CKEditor VIEW Page, that views the text in CKEditor

How can I make CKEditor in the view page READ only, meaning the user can not edit the text in the note? The reason I want to use CKEditor in the view page is for 2 reasons: 1. I can use JavaScript to move the editor from disabled to enabled 2. Keep the styles the same from the POST & View page.

Is this possible? Thanks!

B

I have the following: POST page that allows users to write text in CKEditor VIEW Page, that views the text in CKEditor

How can I make CKEditor in the view page READ only, meaning the user can not edit the text in the note? The reason I want to use CKEditor in the view page is for 2 reasons: 1. I can use JavaScript to move the editor from disabled to enabled 2. Keep the styles the same from the POST & View page.

Is this possible? Thanks!

B

Share Improve this question edited May 23, 2013 at 16:51 Donatas Olsevičius 1,3508 silver badges13 bronze badges asked Dec 21, 2009 at 23:07 AnApprenticeAnApprentice 111k202 gold badges637 silver badges1k bronze badges
Add a ment  | 

3 Answers 3

Reset to default 2

not sure if you are still looking for an answer but here is what I did and it was much simpler than the work around they suggest.

<script type="text/javascript">
        window.onload = function () {

            CKEDITOR.on("instanceReady", function (ev) {
                var bodyelement = ev.editor.document.$.body;
                bodyelement.setAttribute("contenteditable", false);


            });
            CKEDITOR.replace('editor1');
        };

    </script>

Check this CKEditor forum entry where the issue is discussed, and a CKEditor team member provides a workaround.

An important update to this thread, as of 3.6 this is supported by: http://docs.cksource./ckeditor_api/symbols/CKEDITOR.editor.html#setReadOnly

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742280371a4414376.html

相关推荐

  • javascript - Disabling CKEditor, Re-enabling with JS - Stack Overflow

    I have the following:POST page that allows users to write text in CKEditorVIEW Page, that views the t

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信