1function CKupdate(){
2 for ( instance in CKEDITOR.instances ){
3 CKEDITOR.instances[instance].updateElement();
4 CKEDITOR.instances[instance].setData('');
5 }
6}
7
8$(document).ready(function(){
9 CKEDITOR.replace( 'comment-textarea' );
10
11 var options = {
12 success: function (html) {
13 $('#comments').append(html);
14 },
15 clearForm: true
16 };
17
18 $('#formcomments').submit(function() {
19 CKupdate();
20 });
21 $('#formcomments').ajaxForm(options);
22});
23