Here i am creating an email editor template. for that template creations i used CKEditor to create templates. Here is my code.
<?php if (isset($_POST['submit']) ) {
//echo $_POST['message']; } ?>
and the script here.
<script>
//<![CDATA[
CKEDITOR.replace( 'message');
//]]>
</script>
and my HTML code here.
<form method="post" action="">
<textarea class="for_set_height" id="message" name="message" style="visibility: hidden; display: none;"></textarea>
<button type="submit" name="submit" value="submit" >
<i class="icon-book on-left"></i>
<span>Cancel</span>
</button>
</form>
and is it possible to save the Ckeditor datas directly using php form submissions.
Actually i dont know why its not working. but i found a way to do it.
Here is my js to save it.
var editor = CKEDITOR.replace('message'); editor.on( 'change', function( evt ) { $('[name="message"]').val(evt.editor.getData());});
hope it will help someone else.