Hamid hd
Hamid hd

Reputation: 103

get save button click event in ckeditor

How can I get the click event of a save button in Ckeditor?

<form method="post" action="insert.php" class="formSubmit">
     <textarea name="editorAbout" id="editorAbout" rows="10" cols="80">

     </textarea>
             <script>
                var roxyFileman = 'fileman/index.html'; 
                $(function(){
                 CKEDITOR.replace( 'editorAbout',{filebrowserBrowseUrl:roxyFileman,
                            filebrowserImageBrowseUrl:roxyFileman+'?type=image',
                            removeDialogTabs: 'link:upload;image:upload'}); 
                            });
                </script>         
</form>

Upvotes: 0

Views: 862

Answers (1)

TonyB
TonyB

Reputation: 433

Save button in CKEditor triggers submit event in parent FORM. So in this case you can catch this with this code:

$('.formSubmit').submit(function () {
        alert('Save button click');
    });

Or if you need really catch save button click, you must do it via finding element of it.

$('.formSubmit .cke_button__save').click(function() {
        alert('Save button click');
    });

I hope it helped you.

Upvotes: 1

Related Questions