사용자 도구

사이트 도구


사이드바

잡개발자:심플웍스:유틸리티:validation

문서의 이전 판입니다!


ValidationUtil

공통

메서드 매개변수 리턴 비고
isString val 체크할 값
opt 옵션
- kor
- eng
- num
- spe
- kor_eng
- kor_num
- kor_spe
- eng_num
- eng_spe
- num_spe
- kor_eng_num
- kor_eng_spe
- kor_num_spe
- eng_num_spe
- kor_eng_num_spe
true / false 문자열 유효성
(공백 입력 가능)
isNumber val 체크할 값
p 소수점 자릿수
true / false 숫자 유효성
val 체크할 값
p 소수점 자릿수
sign 부호 ( + / - )
isMonth val 체크할 값 true / false 연도/월 유효성
(yyyy-MM)
isDate val 체크할 값 true / false 날짜 유효성
(yyyy-MM-dd)
isTime val 체크할 값 true / false 시각 유효성
(HH:mm, HH:mm:ss)
isId val 체크할 값 true / false 아이디 유효성
(4자리 이상, 영문 또는 영문+숫자)
isPassword val 체크할 값
opt 옵션
- eng_num_mix
- eng_num_spe_mix
true / false 비밀번호 복잡성
(4자리 이상)
isDomain val 체크할 값 true / false 도메인 유효성
isIP val 체크할 값 true / false IP 유효성
val 체크할 값
ver 버전
- v4
- v6
isURL val 체크할 값 true / false URL 유효성
val 체크할 값
protocol 프로토콜
- http
- https
isEmail val 체크할 값 true / false 이메일 유효성
isTempEmail val 체크할 값 true / false 임시 이메일 1) 여부
isPhoneNumber val 체크할 값 true / false 전화번호 유효성
isLandlineNumber val 체크할 값 true / false 일반전화번호 유효성
isMobileNumber val 체크할 값 true / false 휴대전화번호 유효성
isRRN val 체크할 값 true / false 주민등록번호 2) 유효성
(13자리 고정)
isBRN val 체크할 값 true / false 사업자등록번호 3) 유효성
(10자리 고정)
isCRN 4) val 체크할 값 true / false 법인등록번호 5) 유효성
(13자리 고정)

JavaScript

메서드 매개변수 리턴 비고
validate FIXME 6) 메시지 유효성 검증

<input type="text" name="sample_input_string" />
<textarea name="sample_textarea_string"></textarea>

<input type="text" name="sample_input_number" />
<input type="text" name="sample_input_number_plus" />
<input type="text" name="sample_input_number_minus" />
<input type="text" name="sample_input_number_decimal" />
<input type="text" name="sample_input_number_decimal_plus" />
<input type="text" name="sample_input_number_decimal_minus" />

<input type="text" name="sample_input_month" />
<input type="text" name="sample_input_date" />
<input type="text" name="sample_input_time" />
<input type="text" name="sample_input_time_ss" />

<input type="text" name="sample_input_id" />
<input type="password" name="sample_input_password" />

<input type="text" name="sample_input_domain" />
<input type="text" name="sample_input_ip" />
<input type="text" name="sample_input_ip_v4" />
<input type="text" name="sample_input_ip_v6" />

<input type="text" name="sample_input_url" />
<input type="text" name="sample_input_url_http" />
<input type="text" name="sample_input_url_https" />

<input type="text" name="sample_input_email" />
<input type="text" name="sample_input_email_temp" />

<input type="text" name="sample_input_phone_number" /
<input type="text" name="sample_input_landline_number" />
<input type="text" name="sample_input_mobile_number" />

<input type="text" name="sample_input_rrn" />
<input type="text" name="sample_input_brn" />

<input type="file" name="sample_input_file" />
<input type="file" name="sample_input_file_multiple" multiple />

<input type="checkbox" name="sample_input_checkbox" value="일" />
<input type="checkbox" name="sample_input_checkbox" value="월" />
<input type="checkbox" name="sample_input_checkbox" value="화" />
<input type="checkbox" name="sample_input_checkbox" value="수" />
<input type="checkbox" name="sample_input_checkbox" value="목" />
<input type="checkbox" name="sample_input_checkbox" value="금" />
<input type="checkbox" name="sample_input_checkbox" value="토" />

<input type="radio" name="sample_input_radio" value="평일" />
<input type="radio" name="sample_input_radio" value="휴일" />

<select name="sample_select">
	<option value="">미선택</option>
	<option value="선택">선택</option>
</select>
<select name="sample_select_multiple" multiple>
	<option value="1월">1월</option>
	<option value="2월">2월</option>
	<option value="3월">3월</option>
	<option value="4월">4월</option>
	<option value="5월">5월</option>
	<option value="6월">6월</option>
	<option value="7월">7월</option>
	<option value="8월">8월</option>
	<option value="9월">9월</option>
	<option value="10월">10월</option>
	<option value="11월">11월</option>
	<option value="12월">12월</option>
</select>

{
	"sample_input_string" : {
		"label": "텍스트",
		"element": "input",
		"data_type": "string",
		"data_format": "kor_eng_num_spe",
		"min_len": 5,
		"max_len": 10,
		"required": true
	},
	"sample_textarea_string" : {
		"label": "텍스트 에어리어",
		"element": "textarea",
		"data_type": "string",
		"data_format": "kor_eng_num_spe",
		"denylist": "개새끼|병신새끼",
		"min_byte": 100,
		"max_byte": 1000,
		"required": true
	},
	"sample_input_number" : {
		"label": "숫자 (정수)",
		"element": "input",
		"data_type": "number",
		"min_num": -100,
		"max_num": 100,
		"required": true
	},
	"sample_input_number_plus" : {
		"label": "숫자 (양의 정수)",
		"element": "input",
		"data_type": "number",
		"data_format": "+",
		"min_num": 1,
		"max_num": 100,
		"required": true
	},
	"sample_input_number_minus" : {
		"label": "숫자 (음의 정수)",
		"element": "input",
		"data_type": "number",
		"data_format": "-",
		"min_num": -100,
		"max_num": -1,
		"required": true
	},
	"sample_input_number_decimal" : {
		"label": "숫자 (실수)",
		"element": "input",
		"data_type": "number",
		"decimal_places": 2,
		"min_num": -100.00,
		"max_num": 100.00,
		"required": true
	},
	"sample_input_number_decimal_plus" : {
		"label": "숫자 (양의 실수)",
		"element": "input",
		"data_type": "number",
		"data_format": "+",
		"decimal_places": 2,
		"min_num": 1.00,
		"max_num": 100.00,
		"required": true
	},
	"sample_input_number_decimal_minus" : {
		"label": "숫자 (음의 실수)",
		"element": "input",
		"data_type": "number",
		"data_format": "-",
		"decimal_places": 2,
		"min_num": -100.00,
		"max_num": -1.00,
		"required": true
	},
	"sample_input_month" : {
		"label": "연도/월",
		"element": "input",
		"data_type": "month",
		"min_ym": "2025-01",
		"max_ym": "2025-12",
		"required": true
	},
	"sample_input_date" : {
		"label": "날짜",
		"element": "input",
		"data_type": "date",
		"min_dt": "2025-01-01",
		"max_dt": "2025-12-31",
		"required": true
	},
	"sample_input_time" : {
		"label": "시각 (HH:mm)",
		"element": "input",
		"data_type": "time",
		"min_tm": "00:00",
		"max_tm": "23:59",
		"required": true
	},
	"sample_input_time_ss" : {
		"label": "시각 (HH:mm:ss)",
		"element": "input",
		"data_type": "time",
		"min_tm": "00:00:00",
		"max_tm": "23:59:59",
		"required": true
	},
	"sample_input_id" : {
		"label": "아이디",
		"element": "input",
		"data_type": "id",
		"min_len": 10,
		"max_len": 20,
		"required": true
	},
	"sample_input_password" : {
		"label": "비밀번호",
		"element": "input",
		"data_type": "password",
		"data_format": "eng_num_spe_mix",
		"min_len": 10,
		"max_len": 20,
		"required": true
	},
	"sample_input_domain" : {
		"label": "도메인",
		"element": "input",
		"data_type": "domain",
		"required": true
	},
	"sample_input_ip" : {
		"label": "IP",
		"element": "input",
		"data_type": "ip",
		"required": true
	},
	"sample_input_ip_v4" : {
		"label": "IPv4",
		"element": "input",
		"data_type": "ip",
		"data_format": "v4",
		"required": true
	},
	"sample_input_ip_v6" : {
		"label": "IPv6",
		"element": "input",
		"data_type": "ip",
		"data_format": "v6",
		"required": true
	},
	"sample_input_url" : {
		"label": "URL",
		"element": "input",
		"data_type": "url",
		"required": true
	},
	"sample_input_url_http" : {
		"label": "URL (http)",
		"element": "input",
		"data_type": "url",
		"data_format": "http",
		"required": true
	},
	"sample_input_url_https" : {
		"label": "URL (https)",
		"element": "input",
		"data_type": "url",
		"data_format": "https",
		"required": true
	},
	"sample_input_email" : {
		"label": "이메일",
		"element": "input",
		"data_type": "email",
		"required": true
	},
	"sample_input_email_temp" : {
		"label": "이메일 & 임시 이메일 차단",
		"element": "input",
		"data_type": "email",
		"temp_email": "deny",
		"required": true
	},
	"sample_input_phone_number" : {
		"label": "전화번호",
		"element": "input",
		"data_type": "phone_number",
		"required": true
	},
	"sample_input_landline_number" : {
		"label": "일반전화번호",
		"element": "input",
		"data_type": "landline_number",
		"required": true
	},
	"sample_input_mobile_number" : {
		"label": "휴대전화번호",
		"element": "input",
		"data_type": "mobile_number",
		"required": true
	},
	"sample_input_rrn" : {
		"label": "주민등록번호",
		"element": "input",
		"data_type": "rrn",
		"required": true
	},
	"sample_input_brn" : {
		"label": "사업자등록번호",
		"element": "input",
		"data_type": "brn",
		"required": true
	},
	"sample_input_file" : {
		"label": "파일",
		"element": "input",
		"data_type": "file",
		"file_size_limit": "1024 * 1024 * 1",
		"file_ext_allowlist": "jpg|jpeg|png|gif|bmp",
		"required": true
	},
	"sample_input_file_multiple" : {
		"label": "파일 여러개",
		"element": "input",
		"data_type": "file",
		"file_size_limit": "1024 * 1024 * 1",
		"file_ext_allowlist": "jpg|jpeg|png|gif|bmp",
		"min_cnt": 1,
		"max_cnt": 5,
		"required": true
	},
	"sample_input_checkbox" : {
		"label": "체크박스",
		"element": "input",
		"data_type": "checkbox",
		"min_chk": 2,
		"max_chk": 4,
		"required": true
	},
	"sample_input_radio" : {
		"label": "라디오버튼",
		"element": "input",
		"data_type": "radio",
		"required": true
	},
	"sample_select" : {
		"label": "셀렉트박스",
		"element": "select",
		"required": true
	},
	"sample_select_multiple" : {
		"label": "셀렉트박스 다중선택",
		"element": "select",
		"min_sel": 2,
		"max_sel": 4,
		"required": true
	}
}

2)
Resident Registration Number
3)
Business Registration Number
4)
2025년 1월 31일부터 발급된 법인등록번호는 검증 불가
5)
Company Registration Number
6)
강력 빈 값 체크