제이쿼리로 (Validate) 폼 검증 하기
Client Side/Jquery2014. 11. 11. 01:34
최신 버전의 제이쿼리를 받아 올 수 있도록 최상단에 위치 시키고...
![](https://i1.daumcdn.net/cfs.tistory/v/0/blog/image/extension/unknown.gif)
위 파일을 *.js 파일로 저장 후 읽어 올 수 있도록 한다.
jQuery(function($) { $.validator.setDefaults({ submitHandler: function() { alert("submitted!"); } }); $().ready(function() { // validate signup form on keyup and submit $("#signupForm").validate({ rules: { member_id: { required: true, minlength: 8 }, member_name: { required: true, minlength: 8 }, member_nick: { required: true, minlength: 8 }, member_homoe: { required: true, minlength: 8 }, }, messages: { member_id: { required: "아이디를 입력 해 주세요", minlength: "최소 8자 이상 입력 해 주세요", }, member_name: { required: "대표자명을 입력 해 주세요", minlength: "최소 8자 이상 입력 해 주세요", }, member_nick: { required: "회사명을 입력 해 주세요", minlength: "최소 8자 이상 입력 해 주세요", }, member_home: { required: "전화번호를 입력 해 주세요", minlength: "최소 8자 이상 입력 해 주세요", }, } }); }); });
기호에 맞게 쓰도록 한다.
'Client Side > Jquery' 카테고리의 다른 글
업 롤링 스크립트 (0) | 2014.11.27 |
---|---|
탭 제이쿼리 단일 페이지에서 여러가지 내용 보여줄 때 (0) | 2014.11.20 |
썸네일 제이쿼리 (0) | 2014.11.14 |
후버 로테이트 제이쿼리 (0) | 2014.11.13 |
이미지 로테이트 제이쿼리 (0) | 2014.11.13 |