1
votes

I am using TinyMce editor in my webpage. Where whenever user enters some text, he should not be able to delete the text... (Disabling the backspace Key) or else if he uses backspace key text should be strikethough (change functionality of backspace). Is there a function in tinymce to do this?

if (((e.which === 8 || e.keyCode === 8))||(e.which === 46 || e.keyCode === 46)) { // Delete key
          // Do something
          var rng = ed.selection.getRng(true);
        var txt = rng.startContainer.textContent;
          fncAddText(txt.substring(rng.startOffset - 1, rng.startOffset));
          handled = true;
        }
      if (handled) {
        tinymce.dom.Event.cancel(e);
      }      
    function fncAddText(txt) {
        var theText="<del>"+txt+"</del>";
        tinyMCE.execCommand('mceReplaceContent',false,theText);
    }
1

1 Answers

0
votes

No, there exists nothing like this in the code shipped with tinymce nor do i know of a plugin elsewhere with this functionality. But you are free to create something like this yourself.