Hi,
I have been looking at code for hours and cannot seem to solve this one myself, or fully understand what I should be doing based on all of the FAQ and tutorials.
I am using jQuery to POST without leaving the page based on this tutorial, http://net.tutsplus.com/tutorials/javas ... ng-jquery/
Although when I try and pull the data from the text area (which CKEditor is wrapped around via the class), no content is passed through.
I am guessing this is due to the content actually being stored within the CKEditors instance, and not on the actual page.
So I tried to all the following code to my jQuery code, to no avail.
var editor = $('.jquery_ckeditor').ckeditorGet(); alert( editor.checkDirty() ); // Get the editor data. var data = $( 'textarea.editor' ).val();
For reference, here is the section (which needs adapting - but im unsure how) that will pull the content from an 'input' field, but not a 'textarea' (with CKEditor class)
var messagecontent = $("input#messagecontent").val(); if (messagecontent == "" ) { $("label#messagecontent_error").show(); $("label#messagecontent").focus(); return false; }
I am in the very early stages of trying to understand JavaScript / jQuery / CKEditor so any pointers on this issue would be greatly appreciated.
Thanks
Michael
Re: jQuery to post data without leaving page & textarea?
Did you try editor.updateElement() ?
See
http://docs.cksource.com/ckeditor_api/s ... ateElement
Re: jQuery to post data without leaving page & textarea?
Genius! Thanks very much for help and quick reply
All working great now.
Thanks
Michael