CodeCook
CodeCook

Reputation: 188

ckeditor onChange event

i am using ckeditor,now i want to translate the content in onChange event using google translation api[is there any other methods ?]

so i think that i need the onChange event of ckeditor ,

i tried this but not working...

$('.CKeditor').ckeditor();
for (var i in CKEDITOR.instances) {
    CKEDITOR.instances[i].on('change', function() {alert('text changed!');});
}

is there any possibilities ?

Note :: My Requirment is a text box that can enter arabic text[but i need a rich text editor] other methods are welcome!

Thank you.

Upvotes: 2

Views: 4033

Answers (1)

Miguel
Miguel

Reputation: 168

There are some issues with the change event, try something like:

CKEDITOR.instances[name].on("instanceReady", function(){                    
this.document.on("keyup", function(){
    t.text(CKEDITOR.instances[name].getData());
    t.trigger("change");
});
});

Upvotes: 3

Related Questions