I can’t get the correct value from the textarea
<textarea class="ckeditor" name="cmscontent" id="cmscontent"></textarea>
<script type="text/javascript">
CKEDITOR.replace('cmscontent');
</script>
I’m using a JSON request to send it to the server, and the $_POST['cmscontent'] value stays empty all the time. Is there something else I have to do?
You need to call
editor.updateElement()before you send AJAX request saving content. This method will update the textarea element with contents of the editor.You can get the
editorinstance fromCKEDITOR.replace()or from instances object –CKEDITOR.instances.cmscontent.