목록번호 발리데이션 추가

main
이범준 1 year ago
parent dff9665894
commit 66fc896588

@ -140,7 +140,7 @@
<label for="listNo--${pageName}" <label for="listNo--${pageName}"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required">목록번호</label> class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required">목록번호</label>
<input type="text" id="listNo--${pageName}" name="listNo" required <input type="text" id="listNo--${pageName}" name="listNo" required
class="form-control" /> class="form-control" type="text" maxlength="6" data-maxlengthb="6" data-fmt-type="zeroLpadNumber" />
</div> </div>
</div> </div>
</div> </div>

@ -37,6 +37,13 @@ function customValidate(targetArr) {
return false; 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; 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) { function isTime(str) {

Loading…
Cancel
Save