Elitmiar
Elitmiar

Reputation: 36839

How to disable all tinyMCE textarea?

I have a form with about 10 small tinyMCE editors, when I click the disable button, I want these fields to be readonly? Is this possible, non of then have id's. Can I do this via any method, may it be JavaScript, JQuery?

I tried these methods, but the do not work

tinyMCE.init( {mode: "none",readonly : true });
$('input, select, textarea').attr('disabled', 'disabled');

Upvotes: 3

Views: 9878

Answers (2)

Thariama
Thariama

Reputation: 50832

This will cycle over all of the editor instances and shut them down

for (var i = tinymce.editors.length - 1; i >= 0; i--) {
  tinyMCE.execCommand("mceRemoveControl", true, tinymce.editors[i].id);
}

Upvotes: 5

Shakti Singh
Shakti Singh

Reputation: 86386

Here is what you are trying

http://tinymce.moxiecode.com/punbb/viewtopic.php?id=436

Upvotes: 3

Related Questions