Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"

like image 916
erikvimz Avatar asked Jul 27 '12 12:07

erikvimz


People also ask

How do I empty CKEditor?

Try it may helpful. function CKupdate(){ for ( instance in CKEDITOR. instances ){ CKEDITOR.

What is CKEditor replace?

Ckeditor 4 allows you to replace multiple textareas with editors based on classname: CKEDITOR.

What is JavaScript CKEditor?

CKEditor is a modern, feature-rich JavaScript text editor with clean UI and perfect UX. Easily customizable to any use case.


1 Answers

This will destroy all CKEDITOR instances on a page:

for(name in CKEDITOR.instances)
{
    CKEDITOR.instances[name].destroy(true);
}
like image 127
AlfonsoML Avatar answered Oct 22 '22 17:10

AlfonsoML