views:

38

answers:

1

I'm dynamically creating and destroying textareas for this purpose. However, when I create a textarea and then an instance of it in tinymce--then come back to the page again, it doesn't work. I've found that the solution is to simply remove any existing instance of that same name, but I was wondering if it's possible to just do it at startup.

Thanks in advance!

A: 

You have to make sure that the textareas or other elements for which you create a tiny instance need to have different ids.

To remove all tinymce instance you may use:

for (var i=0; i<tinymce.editors.length; i++) {
  tinyMCE.execCommand('mceRemoveControl',false, tinymce.editors[i].id); 
};

Make sure to shut down instances the right way when you try to reinitialize a tinymce instance. Otherwise your editor window could stay white or it is not editable at all.

Thariama