Q:

Managing TinyMCE instances dynamically with jQuery, hidden/not hidden elements, etc

When my web page loads, I assign all TEXTAREA elements by class to TinyMCE like this:
if ($('.assigntinymce').length){
    tinyMCE.init({
        plugins: 'lists,link,code',
        selector:'.assigntinymce',
        branding:false,
        menubar:false,
        statusbar:false,
        toolbar:'bold italic underline | fontsizeselect | forecolor | bullist numlist | alignleft aligncenter alignright | link | code | undo redo',
        content_css:'css/main.css'
    });
}

However, due to user interactions, I may want to hide some of those elements or reveal hidden TEXTAREA elements.
If I try to hide a TEXTAREA element where TinyMCE has already been assigned, the TinyMCE elements remain. What is the correct set of steps to completely remove TinyMCE from that element? I know there is a remove() option, but that doesn't seem to be working for me. I must also remove an ID or something like that?
Conversely, if I have a hidden TEXTAREA element (TinyMCE not assigned), and run the code above, the element is not converted to TinyMCE. Is it correct TinyMCE will not assign to a hidden TEXTAREA? If I then make the TEXTAREA element not hidden, I should be able to run the same script and assign TinyMCE to that element then?

A:

Without seeing running code it will be hard to say exactly why you have the issues that you do but fundamentally the use of remove() and init() to remove and add TinyMCE to a <textarea> are the correct API calls.  
How you are choosing to show and hide elements will impact this issue.  Some ways to hide an element simply make it not visible via CSS while other ways cause the elements to be removed from the DOM.  The way you are doing this impacts things immensely.
If the way you are hiding an element causes it to be removed from the DOM (and re-added when it is un-hidden) you need to call remove() on that editor instance before it is removed from the DOM.  When you then un-hide the element you need to call init() on the element after it is re-added to the DOM. 
If things are just visually hidden (but still part of the DOM) you should not need to use remove() as the element is always there and TinyMCE can remain attached to the element.
As for your comment on calling init() on a hidden element ... as with above that depends on how it is being hidden.  If it is not really part of the DOM while hidden you can't call init() on an element that is not in the DOM.
EDIT:
Based on your comment I assume you are referring to jQuery functions?  If so a quick review of the jQuery docs for hide() state the following:

The matched elements will be hidden immediately, with no animation.
  This is roughly equivalent to calling .css( "display", "none" )

...I suspect that this means it is indeed removed from the DOM. If you don't use jQuery and instead just use CSS to set visibility = "hidden" does the form behave as expected?

