- 정보공유
[그누보드팁] 그누보드 영카트 유효성 검사 클래스
wrest.js 파일에는 아래와 같은 검사 로직이 있다.
case "required" : wrestRequired(el); break;
case "trim" : wrestTrim(el); break;
case "email" : wrestEmail(el); break;
case "hangul" : wrestHangul(el); break;
case "hangul2" : wrestHangul2(el); break;
case "hangulalpha" : wrestHangulAlpha(el); break;
case "hangulalnum" : wrestHangulAlNum(el); break;
case "nospace" : wrestNospace(el); break;
case "numeric" : wrestNumeric(el); break;
case "alpha" : wrestAlpha(el); break;
case "alnum" : wrestAlNum(el); break;
case "alnum_" : wrestAlNum_(el); break;
case "telnum" : wrestTelNum(el); break;
case "imgext" : wrestImgExt(el); break;
이것을 사용하고 싶으면 아래와 같이 클래스를 적용하면된다.
<input type="text" name="" id="" value="" class="required" style="width:100px;" maxlength="10" />
<input type="text" name="" id="" value="" class="trim" style="width:100px;" maxlength="10" />
<input type="text" name="" id="" value="" class="email" style="width:100px;" maxlength="10" />
<input type="text" name="" id="" value="" class="hangul" style="width:100px;" maxlength="10" />
<input type="text" name="" id="" value="" class="hangul2" style="width:100px;" maxlength="10" />
<input type="text" name="" id="" value="" class="hangulalpha" style="width:100px;" maxlength="10" />
중복도 가능하다.
<input type="text" name="" id="" value="" class="required trim" style="width:100px;" maxlength="10" />