Hello all,
Working with Rich Text Editor, some times we need to disable Tab Key, which creates space between two text or HTML Elements inside the Editor.
To do that we have following block of code:
In HTML Page :
<div id="editor" onkeydown="return disable(this,event);" name="redactor" style="overflow-x: auto; border: 1px solid #abadb3; padding: 15px 10px; width: 100%"></div>
In JavaScript :
function disable(x, e) {
if (e.ctrlKey && e.keyCode === 9) {
return false;
}
}
0 Comment(s)