Hello, i have problem with saving data in CKEditor Inline. There is any my idia, howto -> http://stackoverflow.com/questions/18253244/javascript-copy-text-from-element-into-textarea but it not works.
I have element with id textToBeSaved and in this element are next elements and some of them have contenteditable='true'. I need get all data from element textToBeSaved. My best idea was place it into hidden textarea and send it, but i have problems with get actual data from this element.
Thanks for any answer.
Bump
Bump
Getting data...
You access the inline editor data with CKEDITOR.instances.[blockID].getData() -Where blockID is the ID assigned to the html block which is declared editable.
For example, in a plugin:
var hSaveCmd =
{
modes : { wysiwyg:1, source:1 },
readOnly : 1,
exec : function( editor )
{
document.ajax.data.value = CKEDITOR.instances.textToBeSaved.getData();
SaveFile();
}
};
The bold code will put the edited data into a 'data' field in a form called 'ajax' .. which is then processed and sent off to the server by SaveFile() - Which function need not be inside the CK structure.
Note that you have to specify the ID of the actual editable block, specifying a wrapper ID will not work. It also doesn't seem to work for all types of block element. Best to use DIV.
Hope this helps.
Saving data and knowing the ID
Hi,
Thanks for the above sample, how would I also pass the ID of the region, as I use multiple inlines in a single HTML Page.
Warm Regards
Craig