Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Disable tab (space) on HTML Editor

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 401
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: