<script>
$(function () {
$.numberFilterKeyDown = function(event) {
event = event || window.event
var code = (event.which) ? event.which : event.KeyCode;
if( (code > 47 && code <58) || (code > 95 && code < 106) ||
code === 8 || code === 9 || code === 13 || code === 16 ||
code === 35 || code === 36 || code === 37 || code === 38 ||
code === 39 || code === 40 || code === 46 ) {
return;
}
return false;
}
$.numberFilterKeyUp = function (event) {
event = event || window.event;
var code = (event.which) ? event.which : event.KeyCode;
if( code === 9 || code === 16 || code === 35 || code === 36 ||
code === 37 || code === 38 || code === 39 || code === 40){
return;
} else if ( (code > 47 && code <58) || (code > 95 && code < 106) ||
code === 8 || code === 13 || code === 46 ) {
// 숫자 변동 시 처리 함수
return;
} else {
var target = event.target || window.event.srcElement;
target.value = target.value.replace(/[^0-9]/g, "");
}
}
})
</script>