开发者

How to make CKEditor update the text content without using JQuery?

开发者 https://www.devze.com 2023-03-19 02:35 出处:网络
I am using CKEditor for mailbox. After typing the content in the editor, I need to click on send button. After clicking the mail goes, but without the content that I have typed in it.

I am using CKEditor for mailbox. After typing the content in the editor, I need to click on send button. After clicking the mail goes, but without the content that I have typed in it.

This is because the CKEditor is not updating the value of content until I select the typed text and perform some 开发者_开发百科operation from the toolbar, like Bold, Italic etc.

I have added a javascript: onclick to the send button and trying to reload the editor or perform some operation from toolbar .

Neither I can use JQuery nor any plugin to solve this. What else can I try for this?


Try adding this function to the page and call it on the onclick of the button. It'll update the textarea's with the value of the ckeditor

function UpdateFields() {
    for (instance in CKEDITOR.instances) {
        CKEDITOR.instances[instance].updateElement();
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消