I'm trying to detect if something is changed in a CKEditor using jquery, but can't get it to work.
var isModified = false;
$('textarea,input').change(function(){
if(!isModified){
isModified = true;
}
});
$(".ckeditor").document.on('keydown', function() { isModified = true; });
window.onbeforeunload = function(){
$(".ckeditor").ckeditorGet().updateElement();
if(isModified){
return "Are you sure you want to leave page?";
}
};
Do anyone know what's needed in order to make it work for CKEditor 3.6.2? It works on all other form elements.