I'm using CKEditor as a wysiwyg editor. My page has some form elements on them which are loaded through an Ajax call. When i fill in all the data including the wysiwyg editor and then hit the Save button nothing is saved. The submitting is also done through an Ajax call.
Nothing is saved because CKEditor isn't updating the original textarea properly. I found an answer that said to do the following before the submit:
for(var instanceName in CKEDITOR.instances) {
console.log(instanceName);
CKEDITOR.instances['element[1][content]'].updateElement();
}
This is triggered everytime before i submit my form. But this code still doesn't update the real textarea with the content that the CKEditor has...
Anyone any idea how i can solve this problem?
I'm using the latest CKEditor (3.6.5, released on 10 October 2012).
Edit
Just noticed through the console of Firefox that updateElement() is undefined when i run the following command:
CKEDITOR.instances['element[1][content]'].updateElement();
But when i run this, then it does return an object:
CKEDITOR.instances['element[1][content]'];