Ckeditor update textarea

后端 未结 10 1628
抹茶落季
抹茶落季 2020-12-01 03:10

I am trying to get the ckeditor working. Obviously it doesn\'t make use of the textarea so on submit the form doesn\'t submit the text in the editor. Beceause I make use of

10条回答
  •  北海茫月
    2020-12-01 03:24

    I just increase that to the response of T.J. and worked for me:

    $("form").on("submit", function(e){
        $('textarea.ckeditor').each(function () {
           var $textarea = $(this);
           $textarea.val(CKEDITOR.instances[$textarea.attr('name')].getData());
        });
    });
    

提交回复
热议问题