The documentation says there is no extra set-up required to use CKEditor (which I love) with ajaxform from jQuery, but I must be doing something wrong because I do not get the changed contents of the textarea submitted.
My html fied looks like this:
my conversion of this to CKEditor looks like this (and it seems to work)
And my binding to AjaxForm looks like this:
Other form fields (not textareas) come through successfully, but the section_notes field shows only what was originally in the field when the form was created (i.e. changes made on-screen using CKEditor are not included).
What am i doing wrong?
Thanks,
Reg
My html fied looks like this:
<div class="fieldarea"><textarea class="TDOnChange" name="section_notes" id="section_notes" ></textarea></div>
my conversion of this to CKEditor looks like this (and it seems to work)
CKEDITOR.config.width = '60%';
CKEDITOR.replace( 'section_notes', { toolbar : 'TextPlus', height : 300 } );
And my binding to AjaxForm looks like this:
// bind form using 'ajaxForm'
var options = {
type: 'POST',
url: 'wc.dll?CMProcess~AjaxSave~&Data=editsection&sk=3620HC8S904592&sh=120',
dataType: 'json',
beforeSubmit: validate,
success: DoResponse
} ;
$('#editsection').ajaxForm(options);
// pre-submit callback
function validate(formData, jqForm, options) {
var queryString = $.param(formData);
alert('About to submit: \n\n' + queryString);
} ;
Other form fields (not textareas) come through successfully, but the section_notes field shows only what was originally in the field when the form was created (i.e. changes made on-screen using CKEditor are not included).
What am i doing wrong?
Thanks,
Reg
Re: CKEditor with ajaxform
Note the addition of "BeforeSerialize" and the getckeditor function.
Is this the only way (or the best way) to do it?
Reg
Re: CKEditor with ajaxform
If you are using jQuery, I guess that you'll have better results if you use correctly the jQuery adapter.
Re: CKEditor with ajaxform
Is it not correct?
Reg