felix
felix

Reputation: 11552

Adding TinyMCE on the fly

I am using the TinyMCE editor. I have a div element. When an edit link is clicked, I would like to replace it with a TinyMCE editor. I added the mceEditor class in the javascript file that will get executed when the edit link is clicked.But it is not working. TinyMCE editor works when I have a textarea during page load. Can someone please tell me how to do it. Thanks.

<textarea id='answer' rows='25' cols='100' class='span-15 mceEditor'></textarea><br />

Upvotes: 1

Views: 1089

Answers (2)

Immutable Brick
Immutable Brick

Reputation: 820

Version 4 of tinymce now uses tinymce.execCommand('mceAddEditor', false, 'elementId'); and tinymce.execCommand('mceRemoveEditor', false, 'elementId');

Upvotes: 1

felix
felix

Reputation: 11552

I added it using tinyMCE.execCommand('mceAddControl',false,'elementId') and removed it using tinyMCE.execCommand('mceRemoveControl',false,'elementId')

Upvotes: 1

Related Questions