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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capturing a Tab Keystroke

Status
Not open for further replies.

WebNickson

Programmer
Dec 8, 2003
46
0
0
SG
Hi,

Can someone show me how to capture a Tab Keystroke in an input box?

I tried the following code but it's not working...

if (window.event.keyCode == 09) {alert('That\'s the TAB key')};




rgds,
Nickson
 
Try this.

function hanldeEvent(evt)
{
evt = (evt) ? evt : ((window.event) ? event : null);

if (evt)
{
if (evt.ctrlKey)
{// Process Control-Click here}
else
{// alert(evt.keyCode);}
}
}
 
lol... we have very similar problem where the pressed key is not responding.

I tried to solve your problem with evt.shiftKey. It responded to Shift-A, etc but not Shift-Right Arrow! Headache man!



rgds,
Nickson
 
fyi, I've solved the problem... changed from keypress event to keydown event and it worked.

rgds,
Nickson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top