How to ajax-submit a form textarea input from CKEditor?

后端 未结 6 1018
故里飘歌
故里飘歌 2020-11-28 04:13

I am using CKEditor, jQuery and jQuery form plugin and I would like to submit contents of the CkEditor form via an Ajax query. Here is my code:

6条回答
  •  孤街浪徒
    2020-11-28 04:41

    If you use the jQuery form plugin, you can use the beforeSubmit option for a more elegant solution:

    $("#form").ajaxForm({
        beforeSubmit:  function()
    {
            /* Before submit */
        for ( instance in CKEDITOR.instances )
        {
            CKEDITOR.instances[instance].updateElement();
        }
    },
    
      // ... other options
    });
    

提交回复
热议问题