Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use the <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#event%3abeforeCommandExec" rel="nofollow">beforeCommandExec</a> event &amp; <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.eventInfo.html#cancel" rel="nofollow">cancel()</a> method:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $('.ckeditoriz').ckeditor(/* config */); $('.ckeditoriz').each(function () { var id = $(this).attr('id'), form = this.form; CKEDITOR.instances[id].on('beforeCommandExec', function (event) { if (event.data.name === 'save') { event.cancel(); $(form).submit(); } }); }); $('.ajaxForm').submit(function (event) { event.preventDefault(); var $this = $(this); $.ajax({ type: $this.attr('method'), url: $this.attr('action'), data: $this.serialize() }); }); }); &lt;/script&gt; &lt;form action="url" method="post" class="ajaxForm"&gt; &lt;!-- Your textarea must have an ID! --&gt; &lt;textarea id="textarea1" name="textarea1" class="ckeditoriz"&gt;&lt;/textarea&gt; &lt;/form&gt; </code></pre> <h2>Update:</h2> <p>This doesn't work in CKEditor versions <strong>4.0</strong>, <strong>4.1</strong>, <strong>4.2</strong>, however it works again since version <strong>4.3</strong>.</p> <p>Since CKEditor version <strong>4.2</strong> you can use the <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-save" rel="nofollow">save</a> event with the <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.eventInfo-method-cancel" rel="nofollow">cancel()</a> method:</p> <pre><code>CKEDITOR.instances[id].on('save', function (event) { event.cancel(); $(form).submit(); }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload