Hello all,
I am programming a web app in Visual Studio 2005 (
VB) which is using Dart's PowerWEB HTML Textbox.
I am trying to capture the Tab Key using onkeydown in jscript and if the HTML Textbox has the focus, I want to kill the tabkey.
My code looks like this:
<script language="javascript" type="text/javascript">
function IEDownKeyCapture()
{
if (window.event.keyCode == 9)
{ var ControlInFocusStr = ?????? <--- This is where I need help
if (ControlInFocusStr == "HtmlBox1") {
event.returnValue = false; // This kills the tab
}
}
}
</script>
</head>
<body
onkeypress ="IEKeyCap()" >
<form id="frmApprovalForm" method="post" runat="server">
....
<cc1:HtmlBox ID="HtmlBox1" runat="server"></cc1:HtmlBox><br />
.....
</form>
</body>
</html>
Can anyone tell me how I can get the name of the control that has focus when the Tab Key has been pressed?
Thanks for your help.
Bill