Suppressing the tab key

Discussion in 'Javascript' started by Paul Thompson, Aug 14, 2003.

  1. Can I use JavaScript in some way to entirely suppress and control the
    tab key, so that I perform all functions that tab performs? I can
    detect the tab key, but can't seem to eliminate it.
    Paul Thompson, Aug 14, 2003
    #1
    1. Advertising

  2. Paul Thompson

    Evertjan. Guest

    Paul Thompson wrote on 14 aug 2003 in comp.lang.javascript:

    > Can I use JavaScript in some way to entirely suppress and control the
    > tab key, so that I perform all functions that tab performs? I can
    > detect the tab key, but can't seem to eliminate it.
    >
    >


    <body onkeydown="if(event.keyCode==9)alert('Tab');return false;">
    <input>
    <input>

    The "return false" will keep the tab in the first textbox.

    Tested IE6 only !!

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Aug 14, 2003
    #2
    1. Advertising

  3. Paul Thompson

    asdf asdf Guest

    If you want to actually insert tabs into a textarea where the cursor
    is (and not necessarily at the end), look at textranges.
    asdf asdf, Aug 26, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Karen Grube

    Urgent: How can I get the enter key to behave like a tab key?

    Karen Grube, Nov 28, 2004, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    298
    Karen Grube
    Nov 29, 2004
  2. M P
    Replies:
    1
    Views:
    466
  3. Robert Nurse
    Replies:
    6
    Views:
    99
    Brandon Blackmoor
    Nov 5, 2004
  4. max
    Replies:
    2
    Views:
    373
    Lambik
    Apr 1, 2007
  5. HopfZ
    Replies:
    0
    Views:
    293
    HopfZ
    Jan 8, 2007
Loading...

Share This Page