How to get tinyMCE content from more than one text area

后端 未结 2 1859
清歌不尽
清歌不尽 2021-01-12 18:35

Hi I have problem when I need to get the content from multiple text areas. So i saw that tinyMCE has methods to take content from specific text area or from active one, but

2条回答
  •  生来不讨喜
    2021-01-12 19:02

    To reach multiple tinymce instances:

    http://www.tinymce.com/wiki.php/API3:property.tinymce.editors

    Example:

    for (edId in tinyMCE.editors)
        tinyMCE.editors[edId].save();
    

    and the best way (my opinion) would be to save the content to an array:

    for (edId in tinyMCE.editors)
        array[edId] = tinyMCE.editors[edId].getContent();
    

提交回复
热议问题