I am trying to get the contents of my ckeditor to be entered into the associated textarea as the user enters the value into the ckeditor.
I have read several helpful threads, namely here and here, but I am going around in circles as my code experience and knowledge is not so great.
I understand how the ckeditor works and that I should be using the change event as described in the post.
I have managed to add the following jquery code to display the alert message when the user enters value into the ckeditor:
for (var i in CKEDITOR.instances) { CKEDITOR.instances[i].on('change', function() {alert('value changed!!')}); }
My text area code is:
<textarea id="id_a_description" rows="10" cols="40" name="a_description" class="input-95pc" style="visibility: hidden; display: none;"></textarea>
How do I change the jquery code above to enter the value from the ckeditor into the associated text area as the users types using the ckeditor change event?
This would really help me out as I am so frustrated at not being able to solve this even-though I think I am very close to the solution.
Full disclosure: I have posted this on stackoverflow but have not got a correct answer.
This is the solution:
This is the solution:
I hope this helps some one out there.
Thanks for sharing!
Thanks for sharing!
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
My task is - save ckeditor
My task is - save ckeditor content via pressing save button without reloading page.
So I am using ajax:
$.ajax($url, {
type: "post",
data: $data,
processData: false,
contentType: false
});
I download ckeditor with full mode. Couldn't figure out how to redefine SAVE button for not to reload the page, but call my function.
So I install SAVE button plugin and add my own SAVE button. All is working, but I want to enable/disable my SAVE button in dependences of checkDirty() value.
In button plugin I wrote:
(function() {
for (var i in CKEDITOR.instances) {
editor = CKEDITOR.instances[i];
editor.on('blur', function() { update_because_text_changed(editor); });
}
When text change via printing my function update_because_text_changed() is summoned but when I shifting smile-image by mouse this function doesn't called.
Please help, and sorry for my English