Erik Kralj Erik Kralj - 1 month ago 29
Javascript Question

Remove all CKEditor instances

I have a form in which I have CKEditor replacing my

<textarea>
s (multiple). I want to remove all CKEditor instances from the page before submitting the form. How can I accomplish this?

I've looked at Remove CKEdit Instance but it didn't help me at all.

NOTE: All my CKEditors have a class "ckedit"

Answer

This will destroy all CKEDITOR instances on a page:

for(name in CKEDITOR.instances)
{
    CKEDITOR.instances[name].destroy(true);
}