How to generate tinymce in ajax generated text area
1 answer
If you show me your code, I can help you better. However, you should be able to call this function and pass the ID of the Ajax-generated TextArea to it.
//add this to your Ajax callback that generates the TextArea
//replace with the Id of the new textarea
var myTextArea = document.getElementById("MyNewTextArea");
generateTinyMCE(myTextArea);
//Add this function to your script tag
function generateTinyMCE(id) {
if (!tinyMCE.get(id))
tinyMCE.execCommand('mceAddControl', false, id);
else
tinyMCE.execCommand('mceRemoveControl', false, id);
}
+1
a source to share