1
votes

So far I had a simple textarea, it looked like this:

<textarea id="mailtemplate4" rows="20" cols="139" name="templatearea4"></textarea>

I am adding the content for this textarea later using Ajax. Now I want to replace this textarea with the tinyMCE Editor. So I added the tiny_mce.js file to my web app and also called the init of tinymce, like this:

tinyMCE.init({
    mode : "textareas",
    theme : "simple"   
});

This replaces my old textarea with the simple tinymce editor, but I cant enter any text and the content is not filled with Ajax. Looking at the source of the page I see that it added some code below my old area, it starts like this:

<span id="mailtemplate4_container" class="mceEditor defaultSimpleSkin">...

I guess thats correct, so what is the problem? Why is the content not filled and why cant I enter any text? The code throws no JavaScript errors.

Thanks!

1
Have you tried doing the AJAX call (and letting it complete) before initialising the tinyMCE instance? TinyMCE will inherit the text from the textbox so switch the order. - Joe Green
Actually you don't have to do anything else, because everything will be done for you on TinyMCE instantiation. All you gotta do is to include tiny_mce.js, then to instantiate. There's bunch of demos - Yang

1 Answers

1
votes

If you did not include the tiny_mce.js on your main doucment you might have problems with the editor to show up.