DETECTING CAPS LOCK ON IN A TEXTBOX
In the textbox keypress event a function is called :<div><asp:TextBox ID="TextBox1" runat="server" onKeypress="isCapLockOn(event)"></asp:TextBox><
</
Now the function is defined as follows :
<script language="javascript" type="text/javascript">
|| ((charKeyCode >= 97 && charKeyCode <= 122) && shiftKey)) {
document.getElementById(
}
document.getElementById(
}
}
function isCapLockOn(e) {var charKeyCode = e.keyCode ? e.keyCode : e.which;var shiftKey = e.shiftKey ? e.shiftKey : ((charKeyCode == 16) ? true : false);if (((charKeyCode >= 65 && charKeyCode <= 90) && !shiftKey)'keyStage').innerHTML = "Caps lock : <b>On</b>";else {'keyStage').innerHTML = "Caps lock : <b>Off</b>";</script>
div id="keyStage" style="color:Red;font-size:80%;"></div>div>
No comments:
Post a Comment