validating multiple TinyMCE Editor

后端 未结 6 822
难免孤独
难免孤独 2020-12-18 12:27

I have a form with multiple TinyMCE editors. Some of the editors are advance and some are simple editors. I have used jquery validation plugin for validation in client-side.

6条回答
  •  有刺的猬
    2020-12-18 12:44

    Try

    $('#submit').click(function() {
    
      for (i=0; i < tinymce.editors.length; i++){
        var content = tinymce.editors[i].getContent(); // get the content
    
        $('#description').val(content); // put it in the textarea
      }
    });
    

    or easier

    $('#submit').click(function() {
         tinymce.triggerSave();
    });
    

提交回复
热议问题