Does anybody know how can I disable the DELETE and BACKSPACE key in CKEditor?
The following code (extracted from sample code of Garry.Yao) only helps to prevent other keys but not DELETE and BACKSPACE:
Thanks,
Kristin
The following code (extracted from sample code of Garry.Yao) only helps to prevent other keys but not DELETE and BACKSPACE:
// Temporary workaround for providing editor 'read-only' toggling functionality.
( function()
{
var cancelEvent = function( evt )
{
evt.cancel();
};
CKEDITOR.editor.prototype.disableKeystrokes = function( isDisabled )
{
// Prevent key handling.
// This does not prevent DELETE and BACKSPACE
this[ isDisabled ? 'on' : 'removeListener' ]( 'key', cancelEvent, null, null, 0 );
this[ isDisabled ? 'on' : 'removeListener' ]( 'selectionChange', cancelEvent, null, null, 0 );
}
} )();
Thanks,
Kristin
