Hi,
You can catch whether a TAB key was pressed in following way,
<html>
<head>
</head>
<body>
<script type="text/javascript">
function AllowAlphabet(e)
{
if (event.keyCode == 9)
{
return false;
}
else
{
return true;
}
}
</script>
<input type="text" id="txtName" onkeydown="return AllowAlphabet(event)">
</body>
</html>
Please check the difference in your code and one I have put here is mostly I have used onkeydown event where you used a onkeypress event.
Let me know if that helps you.