Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ckeditor - onpaste event

Tags:

paste

ckeditor

Does anyone know how I can attach an onpaste event in CKEditor 3.x?

I basically want to grab CTRL + V data and add few text to it and then add it to the editor.

I have looked around but have not found a definitive answer. CKEditor forum is of not much help.

like image 424
Murali Bala Avatar asked Jan 06 '10 01:01

Murali Bala


1 Answers

This should do the trick

var editor = CKEDITOR.instances.YourInputControlName;
editor.on('paste', function(evt) {
    // Update the text
    evt.editor.setData(evt.editor.getData() + ' your additional comments.');
}, editor.element.$);
like image 51
njappboy Avatar answered Oct 21 '22 20:10

njappboy