Suppressing the tab key

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Thompson

    Suppressing the tab key

    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.

  • Evertjan.

    #2
    Re: Suppressing the tab key

    Paul Thompson wrote on 14 aug 2003 in comp.lang.javas cript:
    [color=blue]
    > 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.
    >
    >[/color]

    <body onkeydown="if(e vent.keyCode==9 )alert('Tab');r eturn 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)

    Comment

    • asdf asdf

      #3
      Re: Suppressing the tab key

      If you want to actually insert tabs into a textarea where the cursor
      is (and not necessarily at the end), look at textranges.

      Comment

      Working...