<!-- Script by hscripts.com --> <script type="text/javascript"> function checkCapsLock( e ) { var fKeyCode=0; var myShiftKey=true;var msg='You are pressing shift key or attempting to type in caps'; var myMsg='Caps Lock is On.'; if ( document.all )
{ fKeyCode=e.keyCode; myShiftKey=e.shiftKey; } else if ( document.layers ) { fKeyCode=e.which; myShiftKey=( fKeyCode == 16 ) ? true : false; } else if ( document.getElementById ) { fKeyCode=e.which; myShiftKey=( fKeyCode == 16 ) ? true : false; } if ( ( fKeyCode >= 65 && fKeyCode <= 90 ) && !myShiftKey ) { alert( myMsg ); } } function ctck() { var sds = document.getElementById("dum"); if(sds == null){alert("You are using a free package.\n You are not allowed to remove the tag.\n");} var sdss = document.getElementById("dumdiv"); if(sdss == null){alert("You are using a free package.\n You are not allowed to remove the tag.\n");} } document.onLoad=ctck(); </script> <!-- Script by hscripts.com -->
For customization of this script or any script development, mail to support@hscripts.com
Usage
Copy and Paste the Html code into the <body> tag.
Then Copy the javascript code into <head> tag of your page.
The important portion is the onKeypress event call in the form, "onKeyPress=checkCapsLock( event )". Here we call the function checkCapsLock to check whether the caps lock is on or not.