I am sharing this since it was impossible to find with Google.
Before CKEditor 4.2 if you wanted to handle the save event with a custom function, you had to write your own plugin.
Now all you need to do is to specify the callback upon initialization:
CKEDITOR.replace('ckeditor', { on: { save: function(evt) { // Do something here, for example: console.log(evt.editor.getData()); // If you want to prevent the form submit (if your editor is in a <form> element), return false here return false; } } });
I use ckeditor inline, so it is not inside form element. It doesn’t show the save button even though that I set it in toolbar config. Do you know how to enable it?
Do you have the “save” plugin? Sorry I have not seen your comment before
Man… Really REALLY Thank you! THANK YOU! I have been looking for this like since two days and wasn’t able to find anything.
Wasted a morning on this until I found your not. Thanks!!!
Men! thank you so much! this is what i need! thanks! 🙂
Thank you so much!
It is definitely impossible to find information in version 4 .
Now, I ‘m having issues in replacement obtaining this:
• “the getEditor() is not function”.
I changed ” ckeditor ” by the id of the textarea and got another error:
“The editor CKEditor instance is already connected to the element provided”.
Fortunately I could find the solution through a callback in ” instanceReady ” by Matthew in:
http://stackoverflow.com/a/19868809/2904959
Thanks.
Man! Thank you so much! You don’t realize how glad I am that I found that! After so many wasted hours you made my day! Thanx! 🙂 🙂 🙂