I want to capture the TAB keypress, cancel the default action and call my own javascript function.
This worked for me:
$("[id*=txtName]").on('keydown', function(e) { var keyCode = e.keyCode || e.which; if (keyCode == 9) { e.preventDefault(); alert('Tab Pressed'); } });