From f32200330336f232ef1a8c25e2d49ee7a56caaee Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 20 Jul 2023 10:57:58 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A8=EC=86=8D=EC=88=98=EA=B8=B0=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20validation=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/fims/crdn/crdn05030-info.jsp | 55 +++++++++++--- .../js/fims/framework/cmm/cmmUtil.js | 73 ++++++++++++++++++- 2 files changed, 116 insertions(+), 12 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp index 23353e9c..b0eb2cdf 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp @@ -17,7 +17,7 @@
- - +
- +
- +
- +
@@ -74,15 +78,18 @@
- +
- +
- +
@@ -164,7 +171,8 @@
- +
@@ -190,7 +198,8 @@
- +
@@ -313,14 +322,37 @@ $(document).ready(function(){ }; $P.fnSave = () => { - if (!$("#frmEdit--${pageName} input").validInputs()) return; + + //if (!$("#frmEdit--${pageName} input").validInputs()) return; + if(!customValidate($("#frmEdit--${pageName} input"))) return; + + + + + + //if(){ + //dialog.alert({ + //content:"계도 처리를 하기 위해선 차량번호가 입력되어야 합니다", + //onClose:function(){input.focus();} + //}); + //} + //if(){ + //dialog.alert({ + //content:"계도 처리를 하기 위해선 소유주정보가 입력되어야 합니다.", + //onClose:function(){input.focus();} + //}); + //} + + dialog.alert({ content:"현재 단속 정보를 저장하시겠습니까?", onOK:() => { $P.crdnControl.save($P.formFields.get()); } }); + + }; $P.videoCallback = (snapshots) => { @@ -406,4 +438,5 @@ $(document).ready(function(){ }); + \ No newline at end of file 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 ddee1eb3..ed4569e1 100644 --- a/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js +++ b/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js @@ -1,6 +1,47 @@ /************************************************************************** * validation **************************************************************************/ +function customValidate(targetArr) { + var handler = validationFailureHandler(); + for(var i=0;i="00" && hour<="23"){ + if(minute>="00" && minute<="59"){ + if(second>="00" && second<="59"){ + return true; + } + } + } + + return false; +} + // 날짜체크 function isDate(str) { + str = str.replaceAll("-",""); + if(str.length != 8){ return false; } @@ -53,7 +124,7 @@ function isDate(str) { } - return true; + return false; }