0

I have just two tinymce control - textarea. When I open my page first time, it opens fine but on reopening only first textarea comes properly. Remaining text areas dont have tinymce functionality. I am suspecting there is some issue in removing these controls.

I am removing controls using following line of code: tinymce.execCommand('mceRemoveEditor', true, 'my_original_textarea_id');

My tinymce version is 4.3.

Also,tinymce.editors.length gives me 7. is this the expected value?

priya
  • 21
  • 4
  • It would be very helpful to see working code to help you. Can I suggest you make an example at TinyMCE Fiddle, JS Fiddle, or Codepen and then put a link to that in your question? – Michael Fromin Apr 06 '16 at 18:39
  • Thanks for your response.It is resolved by making tinymce.editors.length=0; – priya Apr 12 '16 at 15:49
  • Possible duplicate of [How do i remove tinyMCE and then re-add it?](https://stackoverflow.com/questions/4651676/how-do-i-remove-tinymce-and-then-re-add-it) – tgrrr Nov 06 '17 at 01:40

1 Answers1

2

tinyMCE.execCommand('mceRemoveEditor', false, inputCtrl.id); tinyMCE.editors.length = 0;

Above two lines worked for me. Here inputCtrl.id is "id" of the control.

priya
  • 21
  • 4