Search code examples
jquerytinymcedisplayobject

TinyMCE content AJAX posted in a display:block div


I have a textarea in a hidden display table (it's a long form with many options). If the user open the section I change the style display and initialise an instance of TinyMCE. (I have tried to init it when the table is hidden but this don't work)

My text area:

<table width="100%" id="tbl_desc_sel" style="display:none;">
<tr>
  <td>
        <textarea cols="65" rows="10" id="MY_DESC" name="MY_DESC"></textarea>

  </td>
</tr>
</table>

The form is posted using jQuery.AJAX type=POST, I use this to retrieve the content in my JS validation form:

jQuery('#MY_DESC').html( tinyMCE.get('MY_DESC').getContent() );

But when the section is closed again (after filling some content), the retrieved content is empty ... if the section is open it work fine.

Any id to resolve the problem ?

Tanks for your help.


Solution

  • I resolved my problem using the jQuery plugin for the editor.

    I'm now able to init the TinyMCE editor on a style="display:none;" <textearea> and post trough AJAX the content even if this <textearea> is hidden.