I am trying to capture a click event on the save button of CKEditor this way
var element = CKEDITOR.document.getById('CKEditor1'); element.on('click', function (ev) { //ev.removeListener(); alert('hello'); return false; });
but it does not work. When I click the save button CKEditor, then the postback happens. if possible, help me with the correct code sample to capture the click event on the Save button in CKEditor. thanks
I got a solution
CKEDITOR.plugins.registered['save'] = { init: function (editor) { var command = editor.addCommand('save', { modes: { wysiwyg: 1, source: 1 }, exec: function (editor) { // Add here custom function for the save button alert('You clicked the save button in CKEditor toolbar!'); } }); editor.ui.addButton('Save', { label: 'Save', command: 'save' }); } }
the above code i was looking for. the above code will help me lock the button click on the save button on the toolbar. thanks
javascript jquery webforms ckeditor
Thomas
source share