Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting TAB Key

Status
Not open for further replies.

ruiter

Programmer
Mar 4, 2002
3
BR
Hi,
I need a urgent help !!!
I need detect when an TAB key is pressed and return a function on javscript ... Please, help me ..
Sorry for my poor english but I realy need this

Ruiter de Paulo Orlandi
ruiter@uol.com.br
 
Code:
if (document.layers)document.captureEvents(Event.KEYDOWN);
document.onkeydown=function(e) {
 var myKey=e?
            document.layers?
             e.which:
            e.keyCode:
           event.keyCode;
 switch(myKey) {
  case 9: alert("TAB has been pressed"); break;
  default: alert(myKey);
 }
};


Stupidly, pre-Gecko Netscape doesn't detect TAB key presses.
bluebrain.gif
blueuniment.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top