I have tried everything. I'm not a javascript expert by any means, but i was wondering if you guys could look at my code and tell me why the keypress isnt working. It works fine on Netscape and Firefox, but not on Internet Explorer. I am trying to fire the keypress event on an asp.net textbox in order for it to move to the textbox once the maximum number of characters have been enterered into the text box. Thanks alot.
<html>
<body>
<head>
<title>CFS</title>
<script LANGUAGE = "javascript">
function tabber4()
{
var num =SSNa.value;
if((num.length)==SSNa.maxLength-1)
SSNb.focus();
}
</script>
</head>
<form runat="server">
<asp:Textbox id="SSNa" runat="server" maxlength="3" tabindex="7" onkeypress="return tabber4();" style="width:30"/> -
<asp:Textbox id="SSNb" runat="server" maxlength="2" tabindex="8" style="width:20"/> -
</form>
</body>
</html>
<html>
<body>
<head>
<title>CFS</title>
<script LANGUAGE = "javascript">
function tabber4()
{
var num =SSNa.value;
if((num.length)==SSNa.maxLength-1)
SSNb.focus();
}
</script>
</head>
<form runat="server">
<asp:Textbox id="SSNa" runat="server" maxlength="3" tabindex="7" onkeypress="return tabber4();" style="width:30"/> -
<asp:Textbox id="SSNb" runat="server" maxlength="2" tabindex="8" style="width:20"/> -
</form>
</body>
</html>