[출처] [JSP] INPUT : 숫자만 입력하기|작성자 시작이반
1. INPUT 태그내에서 한줄처리
onKeypress = "if(event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"
2. function 처리
<script>
function onlyNumber(){
if((event.keyCode<48)||(event.keyCode>57))
event.returnValue=false;
}
</script>
<input type="text" maxlength="2" onKeypress="onlyNumber();" style="ime-mode:disabled">