samsmithnz
Senior Contributor
I'm trying to capture the tab key in my ASP.NET app, I want it to select the first item in the menu. I've added this line to enable my control to recoginise keypresses:
and then with the javascript function:
This captures lots of other keys... (including enter, shirt, ctrl, etc) just not the tab key... it just tabs off the textbox...
what can I do?
Code:
txtEmployee.Attributes.Add("onkeyup", "ProcessKeyPress()")
and then with the javascript function:
Code:
function ProcessKeyPress()
{
var SourceField = event.srcElement;
if(event.keyCode == 9)
{
alert('tab pressed!!!');
}
}
This captures lots of other keys... (including enter, shirt, ctrl, etc) just not the tab key... it just tabs off the textbox...
what can I do?
Last edited: