|
How to get the ID of the control in focus
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
onkeydown="IEDownKeyCapture()" >
<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 ID/Name of the control that has focus when the user presses the Tab Key?
Thanks for your help.
Bill
Last edited by Bill999; 01-31-2007 at 06:42 PM..
Reason: Added missing onkeydown="IEDownKeyCapture()"
|