사용자 도구

사이트 도구


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

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
잡개발자:심플웍스:유틸리티:validation [2025/11/21 17:38]
carlito76
잡개발자:심플웍스:유틸리티:validation [2026/02/12 11:57] (현재)
carlito76
줄 1: 줄 1:
 +{{htmlmetatags>
 +metatag-description=(심플웍스, SimpleWorks, 유틸리티, ValidationUtil)
 +metatag-og:description=(심플웍스, SimpleWorks, 유틸리티, ValidationUtil)
 +}}
 +
 ====== ValidationUtil ====== ====== 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 | 문자열 유효성\\ (공백 입력 가능) |+| isString | val 체크할 값\\ opt 옵션\\ - kor\\ - eng\\ - num\\ - kor_eng\\ - kor_num\\ - kor_etc\\ - eng_num\\ - eng_etc\\ - num_etc\\ - kor_eng_num\\ - kor_eng_etc\\ - kor_num_etc\\ - eng_num_etc | true / false | 문자열 유효성 |
 | isNumber | val 체크할 값\\ p 소수점 자릿수 | true / false | 숫자 유효성 | | isNumber | val 체크할 값\\ p 소수점 자릿수 | true / false | 숫자 유효성 |
 | ::: | val 체크할 값\\ p 소수점 자릿수\\ sign 부호 ( + / - )\\ | ::: | ::: | | ::: | val 체크할 값\\ p 소수점 자릿수\\ sign 부호 ( + / - )\\ | ::: | ::: |
 | isMonth | val 체크할 값 | true / false | 연도/월 유효성\\ (yyyy-MM) | | isMonth | val 체크할 값 | true / false | 연도/월 유효성\\ (yyyy-MM) |
 | isDate | val 체크할 값 | true / false | 날짜 유효성\\ (yyyy-MM-dd) | | isDate | val 체크할 값 | true / false | 날짜 유효성\\ (yyyy-MM-dd) |
-| isTime | val 체크할 값 | true / false | 시각 유효성\\ (HH:mmHH:mm:ss) | +| isTime | val 체크할 값 | true / false | 시각 유효성\\ (HH:mm 또는 HH:mm:ss) | 
-| isId | val 체크할 값 | true / false | 아이디 유효성\\ (4자리 이상영문 또는 영문+숫자) | +| isId | val 체크할 값 | true / false | 아이디 유효성\\ (기본 4자리 이상)\\ (영문 소문자 또는 영문 소문자+숫자) | 
-| isPassword | val 체크할 값\\ opt 옵션\\ - eng_num_mix\\ - eng_num_spe_mix | true / false | 비밀번호 복잡성\\ (4자리 이상) |+| isPassword | val 체크할 값\\ opt 옵션\\ - eng_num_mix\\ - eng_num_spe_mix | true / false | 비밀번호 복잡성\\ (기본 4자리 이상) |
 | isDomain | val 체크할 값 | true / false | 도메인 유효성 | | isDomain | val 체크할 값 | true / false | 도메인 유효성 |
-isIP | val 체크할 값 | true / false | IP 유효성 |+isIp | val 체크할 값 | true / false | IP 유효성 |
 | ::: | val 체크할 값\\ ver 버전\\ - v4\\ - v6 | ::: | ::: | | ::: | val 체크할 값\\ ver 버전\\ - v4\\ - v6 | ::: | ::: |
 | isURL | val 체크할 값 | true / false | URL 유효성 | | isURL | val 체크할 값 | true / false | URL 유효성 |
줄 23: 줄 28:
 | isRRN | val 체크할 값 | true / false | 주민등록번호 ((Resident Registration Number)) 유효성\\ (13자리 고정) | | isRRN | val 체크할 값 | true / false | 주민등록번호 ((Resident Registration Number)) 유효성\\ (13자리 고정) |
 | isBRN | val 체크할 값 | true / false | 사업자등록번호 ((Business Registration Number)) 유효성\\ (10자리 고정) | | isBRN | val 체크할 값 | true / false | 사업자등록번호 ((Business Registration Number)) 유효성\\ (10자리 고정) |
-| isCRN | val 체크할 값 | true / false | 법인등록번호 ((Company Registration Number)) 유효성\\ (13자리 고정) |+<color gray><del>isCRN</del></color> ((2025년 1월 31일부터 발급된 법인등록번호는 검증 불가)) | val 체크할 값 | true / false | 법인등록번호 ((Company Registration Number)) 유효성\\ (13자리 고정) |
  
 ===== JavaScript ===== ===== JavaScript =====
 ^  메서드  ^  매개변수  ^  리턴  ^  비고  ^ ^  메서드  ^  매개변수  ^  리턴  ^  비고  ^
-| validate | FIXME ((강력 빈 값 체크)) | 메시지 | 유효성 검증 |+| validate | FIXME ((FIXME\\ - 강력 빈 값 체크)) | 메시지 | 유효성 검증 |
  
 +==== validate ====
 <sxh html; gutter: true; title: validate.html;> <sxh html; gutter: true; title: validate.html;>
-<input type="text" name="sample_input_string" />+<input type="text" name="sample_input_string">
 <textarea name="sample_textarea_string"></textarea> <textarea name="sample_textarea_string"></textarea>
  
-<input type="text" name="sample_input_number" /+<input type="text" name="sample_input_number"> 
-<input type="text" name="sample_input_number_plus" /+<input type="text" name="sample_input_number_plus"> 
-<input type="text" name="sample_input_number_minus" /+<input type="text" name="sample_input_number_minus"> 
-<input type="text" name="sample_input_number_decimal" /+<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_plus"> 
-<input type="text" name="sample_input_number_decimal_minus" />+<input type="text" name="sample_input_number_decimal_minus">
  
-<input type="text" name="sample_input_month" /+<input type="text" name="sample_input_month"> 
-<input type="text" name="sample_input_date" /+<input type="text" name="sample_input_date"> 
-<input type="text" name="sample_input_time" /+<input type="text" name="sample_input_time"> 
-<input type="text" name="sample_input_time_ss" />+<input type="text" name="sample_input_time_ss">
  
-<input type="text" name="sample_input_id" /+<input type="text" name="sample_input_id"> 
-<input type="password" name="sample_input_password" />+<input type="password" name="sample_input_password">
  
-<input type="text" name="sample_input_domain" /+<input type="text" name="sample_input_domain"> 
-<input type="text" name="sample_input_ip" /+<input type="text" name="sample_input_ip"> 
-<input type="text" name="sample_input_ip_v4" /+<input type="text" name="sample_input_ip_v4"> 
-<input type="text" name="sample_input_ip_v6" />+<input type="text" name="sample_input_ip_v6">
  
-<input type="text" name="sample_input_url" /+<input type="text" name="sample_input_url"> 
-<input type="text" name="sample_input_url_http" /+<input type="text" name="sample_input_url_http"> 
-<input type="text" name="sample_input_url_https" />+<input type="text" name="sample_input_url_https">
  
-<input type="text" name="sample_input_email" /+<input type="text" name="sample_input_email"> 
-<input type="text" name="sample_input_email_temp" />+<input type="text" name="sample_input_email_temp">
  
 <input type="text" name="sample_input_phone_number" / <input type="text" name="sample_input_phone_number" /
-<input type="text" name="sample_input_landline_number" /+<input type="text" name="sample_input_landline_number"> 
-<input type="text" name="sample_input_mobile_number" />+<input type="text" name="sample_input_mobile_number">
  
-<input type="text" name="sample_input_rrn" /+<input type="text" name="sample_input_rrn"> 
-<input type="text" name="sample_input_brn" /> +<input type="text" name="sample_input_brn">
-<input type="text" name="sample_input_crn" />+
  
-<input type="file" name="sample_input_file" /+<input type="file" name="sample_input_file"> 
-<input type="file" name="sample_input_file_multiple" multiple />+<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="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="평일"> 
-<input type="radio" name="sample_input_radio" value="휴일" />+<input type="radio" name="sample_input_radio" value="휴일">
  
 <select name="sample_select"> <select name="sample_select">
줄 109: 줄 114:
  "data_type": "string",  "data_type": "string",
  "data_format": "kor_eng_num_spe",  "data_format": "kor_eng_num_spe",
- "min_len": 5+ "min_len": 10
- "max_len": 10,+ "max_len": 100,
  "required": true  "required": true
  },  },
줄 118: 줄 123:
  "data_type": "string",  "data_type": "string",
  "data_format": "kor_eng_num_spe",  "data_format": "kor_eng_num_spe",
 + "denylist": "개새끼|병신새끼",
  "min_byte": 100,  "min_byte": 100,
  "max_byte": 1000,  "max_byte": 1000,
줄 194: 줄 200:
  },  },
  "sample_input_time" : {  "sample_input_time" : {
- "label": "시각",+ "label": "시각 (HH:mm)",
  "element": "input",  "element": "input",
  "data_type": "time",  "data_type": "time",
줄 202: 줄 208:
  },  },
  "sample_input_time_ss" : {  "sample_input_time_ss" : {
- "label": "시각",+ "label": "시각 (HH:mm:ss)",
  "element": "input",  "element": "input",
  "data_type": "time",  "data_type": "time",
줄 213: 줄 219:
  "element": "input",  "element": "input",
  "data_type": "id",  "data_type": "id",
- "min_len": 10,+ "min_len": 4,
  "max_len": 20,  "max_len": 20,
  "required": true  "required": true
줄 222: 줄 228:
  "data_type": "password",  "data_type": "password",
  "data_format": "eng_num_spe_mix",  "data_format": "eng_num_spe_mix",
- "min_len": 10,+ "min_len": 8,
  "max_len": 20,  "max_len": 20,
  "required": true  "required": true
줄 259: 줄 265:
  },  },
  "sample_input_url_http" : {  "sample_input_url_http" : {
- "label": "URL",+ "label": "URL (http)",
  "element": "input",  "element": "input",
  "data_type": "url",  "data_type": "url",
줄 266: 줄 272:
  },  },
  "sample_input_url_https" : {  "sample_input_url_https" : {
- "label": "URL",+ "label": "URL (https)",
  "element": "input",  "element": "input",
  "data_type": "url",  "data_type": "url",
줄 313: 줄 319:
  "element": "input",  "element": "input",
  "data_type": "brn",  "data_type": "brn",
- "required": true 
- }, 
- "sample_input_crn" : { 
- "label": "법인등록번호", 
- "element": "input", 
- "data_type": "crn", 
  "required": true  "required": true
  },  },
줄 335: 줄 335:
  "file_size_limit": "1024 * 1024 * 1",  "file_size_limit": "1024 * 1024 * 1",
  "file_ext_allowlist": "jpg|jpeg|png|gif|bmp",  "file_ext_allowlist": "jpg|jpeg|png|gif|bmp",
- "min_cnt": 2+ "min_cnt": 1
- "max_cnt": 4,+ "max_cnt": 5,
  "required": true  "required": true
  },  },
줄 367: 줄 367:
 } }
 </sxh> </sxh>
 +
 +{{tag>"심플웍스" "SimpleWorks"}}