<SCRIPT LANGUAGE="JavaScript">
<!--
function checkCapsLock( e ) {
var myKeyCode=0;
var myShiftKey=false;
var myMsg='Caps Lock is On.';
// Internet Explorer 4+
if ( document.all ) {
myKeyCode=e.keyCode;
myShiftKey=e.shiftKey;
// Netscape 4
} else if ( document.layers ) {
myKeyCode=e.which;
myShiftKey=( myKeyCode == 16 ) ? true : false;
// Netscape 6
} else if ( document.getElementById ) {
myKeyCode=e.which;
myShiftKey=( myKeyCode == 16 ) ? true : false;
}
// Upper case letters are seen without depressing the Shift key, therefore Caps Lock is on
if ( ( myKeyCode >= 65 && myKeyCode <= 90 ) && !myShiftKey ) {
alert( myMsg );
// Lower case letters are seen while depressing the Shift key, therefore Caps Lock is on
} else if ( ( myKeyCode >= 97 && myKeyCode <= 122 ) && myShiftKey ) {
alert( myMsg );
}
}
//-->
</script>
<div align="center">
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td width="100%" align="center" valign="top">
<FORM><STRONG>Password:</STRONG>
<INPUT TYPE="Password" NAME="Password" SIZE=16 MAXLENGTH=16 onKeyPress="checkCapsLock( event )">
<P><INPUT TYPE="Reset">
</FORM>
</center>
</div>
'프로그래밍 > JAVA, JSP' 카테고리의 다른 글
JSP SelectBox Option 추가/삭제 (0) | 2013.11.13 |
---|---|
자바(JAVA) FTP 파일 전송 (0) | 2013.11.13 |
HTML CSS 색상표 (0) | 2013.11.13 |
보안 - JSP 마우스 우클릭, 드래그, 복사 금지 (0) | 2013.11.13 |
파비콘(favicon) 만들기/적용 (0) | 2013.11.13 |
댓글