Hamid February 2016

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>

Answers


Scorpio1337 February 2016

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.

Post Status

Asked in February 2016
Viewed 2,732 times
Voted 7
Answered 1 times

Search




Leave an answer