중복확인을 일일이 짜는게 귀찮아서... 아래처럼 해버렸네요 ㅎㅎㅎ
날이 갈수록 꼼수만 늘어 가는 것 같습니다.
ps. 그 누구에게 도움이 되시기를 ㅎㅎ (참고로 디자인 들어가기 전 사전작업 파일 입니다.)
[code]
| <form action="http://example.com/xe/module/app_join/join.php" method="post" onsubmit="return JoinCheck();"> | |
| 이름<input type="text" name="name" required><br> | |
| 휴대번호<input type="text" name="phone" id="phone" required class="telnum"> | |
| <a href="#" class="duplication" ac-type="phone" ac-target="#phone" ac-output="#phone_val" ac-name="휴대번호" class="btn30">중복확인</a> | |
| <span id="phone_val"></span> | |
| <br> | |
| 이메일<input type="text" name="email" class="email" required> | |
| <a href="#" class="duplication" ac-type="email" ac-target=".email" ac-output="#email_val" ac-name="이메일" class="btn30">중복확인</a> | |
| <span id="email_val"></span><br> | |
| 비밀번호<input type="password" name="password" required><br> | |
| 비밀번호 확인<input type="password" name="password_re" id="password_re" required> | |
| <span></span><br> | |
| <input type="submit" value="전송"> | |
| </form> | |
| <script type="text/javascript"> | |
| $(function() { | |
| window.duplicationValue = []; | |
| window.duplicationIndex = []; | |
| var i = 0; | |
| $('.duplication').each(function() { | |
| var type = $(this).attr('ac-type'); | |
| var name = $(this).attr('ac-name'); | |
| var arr = []; | |
| arr['type'] = type; | |
| arr['name'] = name; | |
| // array push | |
| window.duplicationValue.push(arr); | |
| // 인덱스 값 기록 | |
| window.duplicationIndex[type] = i; | |
| i++; | |
| }); | |
| $('.duplication').on('click', function(e) { | |
| e.preventDefault(); | |
| var type = $(this).attr('ac-type'); | |
| var name = $(this).attr('ac-name'); | |
| var target = $(this).attr('ac-target'); | |
| var output = $(this).attr('ac-output'); | |
| var index = window.duplicationIndex[type]; | |
| // 입력값 확인 | |
| if(!$(target).val()) { | |
| alert(name+'(을)를 입력하여주세요.'); | |
| $(target).focus(); | |
| return false; | |
| } | |
| // 중복확인 | |
| new AjaxTB(output, 'http://example.com/xe/module/app_join/ajax/duplication.check.php', '?type='+type+'&val='+$(target).val()).Sender(); | |
| window.duplicationValue[index]['val'] = $(target).val(); | |
| window.duplicationValue[index]['target'] = target; | |
| window.duplicationValue[index]['duplication'] = $('#duplication_'+type).val(); | |
| }); | |
| }); | |
| // submit 검사 | |
| function JoinCheck() { | |
| var msg; | |
| // 유효성 검사 | |
| for(var i=0; i<window.duplicationValue.length; i++) { | |
| if(window.duplicationValue[i]['duplication'] == 1) { | |
| var duplication = window.duplicationValue[i]['duplication']; | |
| var target = window.duplicationValue[i]['target']; | |
| var type = window.duplicationValue[i]['type']; | |
| var name = window.duplicationValue[i]['name']; | |
| var val = window.duplicationValue[i]['val']; | |
| msg = val+'(은)는 다른 사용자께서 사용중입니다.'; | |
| break; | |
| } | |
| } | |
| // 비밀번호 유효성 검사 | |
| if($('input[name=password]').val() != $('input[name=password_re]').val() && !msg) { | |
| msg = '비밀번화 확인이 일치 하지 않습니다.'; | |
| target = '#password_re'; | |
| } | |
| // 에러 메시지가 있다면 return 하지 않고 메시지를 보여줌 | |
| if(msg) { | |
| alert(msg); | |
| $(target).focus(); | |
| return false; | |
| } | |
| } | |
| </script> |
[/code]
댓글 2개
11년 전
캬~~ XE 모듈도 만드실 수 있다니 리얼 능력자~!!!
Terrorboy
11년 전
xe모듈은 아니구요.
그누 확장 기능 폴더 명이 xe입니다.
그누 확장 기능 폴더 명이 xe입니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7030 | 11년 전 | 1420 | ||
| 7029 |
|
11년 전 | 3250 | |
| 7028 |
|
11년 전 | 1146 | |
| 7027 | 11년 전 | 1014 | ||
| 7026 | 11년 전 | 2090 | ||
| 7025 |
어려워요잉
|
11년 전 | 2745 | |
| 7024 | 11년 전 | 2107 | ||
| 7023 | 11년 전 | 3142 | ||
| 7022 |
Shhhh
|
11년 전 | 1539 | |
| 7021 |
|
11년 전 | 3286 | |
| 7020 | 11년 전 | 796 | ||
| 7019 |
막돼먹은영애
|
11년 전 | 1088 | |
| 7018 | 11년 전 | 1965 | ||
| 7017 | 11년 전 | 2327 | ||
| 7016 | 11년 전 | 1034 | ||
| 7015 | 11년 전 | 2835 | ||
| 7014 | 11년 전 | 3033 | ||
| 7013 | 11년 전 | 1520 | ||
| 7012 |
|
11년 전 | 2199 | |
| 7011 | 11년 전 | 1050 | ||
| 7010 | 11년 전 | 1407 | ||
| 7009 |
|
11년 전 | 1084 | |
| 7008 | 11년 전 | 2271 | ||
| 7007 | 11년 전 | 2193 | ||
| 7006 |
|
11년 전 | 1182 | |
| 7005 | 11년 전 | 5314 | ||
| 7004 | 11년 전 | 2365 | ||
| 7003 | 11년 전 | 3079 | ||
| 7002 | 11년 전 | 1930 | ||
| 7001 | 11년 전 | 976 | ||
| 7000 | 11년 전 | 2052 | ||
| 6999 |
|
11년 전 | 2176 | |
| 6998 | 11년 전 | 1890 | ||
| 6997 |
네이비칼라
|
11년 전 | 1501 | |
| 6996 | 11년 전 | 960 | ||
| 6995 |
|
11년 전 | 1863 | |
| 6994 | 11년 전 | 2580 | ||
| 6993 |
kimsdesign
|
11년 전 | 1305 | |
| 6992 |
|
11년 전 | 2778 | |
| 6991 | 11년 전 | 1722 | ||
| 6990 | 11년 전 | 4481 | ||
| 6989 | 11년 전 | 1862 | ||
| 6988 |
네이비컬러
|
11년 전 | 2526 | |
| 6987 | 11년 전 | 3734 | ||
| 6986 |
잘살아보자
|
11년 전 | 1598 | |
| 6985 |
잘살아보자
|
11년 전 | 2483 | |
| 6984 | 11년 전 | 831 | ||
| 6983 |
천재조상훈
|
11년 전 | 1878 | |
| 6982 |
천재조상훈
|
11년 전 | 4510 | |
| 6981 |
천재조상훈
|
11년 전 | 1638 | |
| 6980 |
|
11년 전 | 1889 | |
| 6979 |
|
11년 전 | 763 | |
| 6978 |
잘살아보자
|
11년 전 | 1151 | |
| 6977 |
잘살아보자
|
11년 전 | 1474 | |
| 6976 |
잘살아보자
|
11년 전 | 1583 | |
| 6975 |
천재조상훈
|
11년 전 | 1490 | |
| 6974 |
잘살아보자
|
11년 전 | 2235 | |
| 6973 |
잘살아보자
|
11년 전 | 1163 | |
| 6972 |
잘살아보자
|
11년 전 | 3074 | |
| 6971 |
잘살아보자
|
11년 전 | 3280 | |
| 6970 |
잘살아보자
|
11년 전 | 1850 | |
| 6969 |
잘살아보자
|
11년 전 | 4786 | |
| 6968 | 11년 전 | 9914 | ||
| 6967 |
|
11년 전 | 2644 | |
| 6966 |
|
11년 전 | 1119 | |
| 6965 | 11년 전 | 3265 | ||
| 6964 | 11년 전 | 2587 | ||
| 6963 | 11년 전 | 2108 | ||
| 6962 |
star3840
|
11년 전 | 1022 | |
| 6961 | 11년 전 | 4247 | ||
| 6960 |
|
11년 전 | 738 | |
| 6959 | 11년 전 | 1261 | ||
| 6958 |
|
11년 전 | 1681 | |
| 6957 | 11년 전 | 1907 | ||
| 6956 |
잘살아보자
|
11년 전 | 1853 | |
| 6955 | 11년 전 | 4631 | ||
| 6954 | 11년 전 | 1634 | ||
| 6953 |
잘살아보자
|
11년 전 | 883 | |
| 6952 |
잘살아보자
|
11년 전 | 2053 | |
| 6951 | 11년 전 | 1617 | ||
| 6950 | 11년 전 | 2618 | ||
| 6949 |
잘살아보자
|
11년 전 | 891 | |
| 6948 | 11년 전 | 1564 | ||
| 6947 | 11년 전 | 1472 | ||
| 6946 | 11년 전 | 1620 | ||
| 6945 | 11년 전 | 1231 | ||
| 6944 | 11년 전 | 1193 | ||
| 6943 | 11년 전 | 1236 | ||
| 6942 | 11년 전 | 1592 | ||
| 6941 | 11년 전 | 1663 | ||
| 6940 | 11년 전 | 1759 | ||
| 6939 | 11년 전 | 1672 | ||
| 6938 | 11년 전 | 1951 | ||
| 6937 | 11년 전 | 1158 | ||
| 6936 | 11년 전 | 1362 | ||
| 6935 | 11년 전 | 1308 | ||
| 6934 | 11년 전 | 1473 | ||
| 6933 | 11년 전 | 1982 | ||
| 6932 | 11년 전 | 1543 | ||
| 6931 | 11년 전 | 1549 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기