From 66fc896588ed15d7091e7f5f91c5a2cc11765695 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Wed, 30 Aug 2023 18:10:58 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AA=A9=EB=A1=9D=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EB=B0=9C=EB=A6=AC=EB=8D=B0=EC=9D=B4=EC=85=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp | 2 +- .../resources/js/fims/framework/cmm/cmmUtil.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp index 197d260a..9ffc9507 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp @@ -140,7 +140,7 @@ + class="form-control" type="text" maxlength="6" data-maxlengthb="6" data-fmt-type="zeroLpadNumber" /> diff --git a/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js b/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js index 8b68f242..a0ff2c9c 100644 --- a/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js +++ b/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js @@ -37,6 +37,13 @@ function customValidate(targetArr) { return false; } } + + if(input.dataset.fmtType == "zeroLpadNumber"){ + if(!isDigitString(input.value)){ + handler.typeMismatch(input); + return false; + } + } } } @@ -52,6 +59,15 @@ function isNumber(str, exceptChar) { return (/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/).test(str.replaceAll(exceptChar,"")) ? true : false; }; +/** + * 문자열이 숫자형문자 인지의 여부를 반환한다.(0~9만 허용) + * @param + * @return 숫자형문자 여부 + */ +function isDigitString(str) { + return (/^[0-9]+$/).test(str) ? true : false; +}; + // 시간체크 function isTime(str) {