In my php program I display input forms either regular way on page load or in a dialog box using ajax calls.
There are two methods to create a CKEditor from textarea. Either to use jQuery
$("#textareaid").ckeditor();
or
window["textareaid"] = CKEDITOR.replace("textareaid");
Both methods creates my rich text editor inplace of my textarea in both cases either on page load or after an ajax call. That’s fine.
Here starts the problems. In these conditions CKEditor initiates without any console errors, but it never updates textarea value and always sends old value.
1) If I create my textarea on page load and use $("#textareaid").ckeditor();. CKEditor initiates ok without any console errors but on regular form submit, the sent value is empty (old value).
2) If I create my textarea after an ajax call and use window["textareaid"] = CKEDITOR.replace("textareaid"); . Again CKEditor initiates correctly but if I do $(“form”).serialize() and alert the result I see that textarea value is empty (old value).
I can’t create a demo page and upload right now and I know that no one will try to replicate this issue without my codes (at least I wouldn’t because I’m so lazy)
I’ll prepare a demo page to replicate this issue for you guys but until then I’m asking if someone here faced the same problem and know the reason or found a solution?
Thanks
You should be ok if you call:
‘your instance’ in the eaxmple would be simply
textareaidsince that’s what you’re using in theCKEDITOR.replace()functionbefore you serialize the form.
Had the exact same problems a couple of days ago 🙂