중복확인을 일일이 짜는게 귀찮아서... 아래처럼 해버렸네요 ㅎㅎㅎ
날이 갈수록 꼼수만 늘어 가는 것 같습니다.
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년 전 | 1407 | ||
| 7029 |
|
11년 전 | 3245 | |
| 7028 |
|
11년 전 | 1141 | |
| 7027 | 11년 전 | 1009 | ||
| 7026 | 11년 전 | 2084 | ||
| 7025 |
어려워요잉
|
11년 전 | 2744 | |
| 7024 | 11년 전 | 2104 | ||
| 7023 | 11년 전 | 3131 | ||
| 7022 |
Shhhh
|
11년 전 | 1527 | |
| 7021 |
|
11년 전 | 3272 | |
| 7020 | 11년 전 | 790 | ||
| 7019 |
막돼먹은영애
|
11년 전 | 1085 | |
| 7018 | 11년 전 | 1958 | ||
| 7017 | 11년 전 | 2323 | ||
| 7016 | 11년 전 | 1027 | ||
| 7015 | 11년 전 | 2827 | ||
| 7014 | 11년 전 | 3030 | ||
| 7013 | 11년 전 | 1518 | ||
| 7012 |
|
11년 전 | 2196 | |
| 7011 | 11년 전 | 1049 | ||
| 7010 | 11년 전 | 1402 | ||
| 7009 |
|
11년 전 | 1073 | |
| 7008 | 11년 전 | 2268 | ||
| 7007 | 11년 전 | 2185 | ||
| 7006 |
|
11년 전 | 1178 | |
| 7005 | 11년 전 | 5310 | ||
| 7004 | 11년 전 | 2358 | ||
| 7003 | 11년 전 | 3072 | ||
| 7002 | 11년 전 | 1920 | ||
| 7001 | 11년 전 | 957 | ||
| 7000 | 11년 전 | 2046 | ||
| 6999 |
|
11년 전 | 2162 | |
| 6998 | 11년 전 | 1876 | ||
| 6997 |
네이비칼라
|
11년 전 | 1494 | |
| 6996 | 11년 전 | 953 | ||
| 6995 |
|
11년 전 | 1856 | |
| 6994 | 11년 전 | 2577 | ||
| 6993 |
kimsdesign
|
11년 전 | 1299 | |
| 6992 |
|
11년 전 | 2773 | |
| 6991 | 11년 전 | 1719 | ||
| 6990 | 11년 전 | 4473 | ||
| 6989 | 11년 전 | 1852 | ||
| 6988 |
네이비컬러
|
11년 전 | 2511 | |
| 6987 | 11년 전 | 3727 | ||
| 6986 |
잘살아보자
|
11년 전 | 1592 | |
| 6985 |
잘살아보자
|
11년 전 | 2468 | |
| 6984 | 11년 전 | 823 | ||
| 6983 |
천재조상훈
|
11년 전 | 1865 | |
| 6982 |
천재조상훈
|
11년 전 | 4496 | |
| 6981 |
천재조상훈
|
11년 전 | 1629 | |
| 6980 |
|
11년 전 | 1878 | |
| 6979 |
|
11년 전 | 757 | |
| 6978 |
잘살아보자
|
11년 전 | 1144 | |
| 6977 |
잘살아보자
|
11년 전 | 1467 | |
| 6976 |
잘살아보자
|
11년 전 | 1575 | |
| 6975 |
천재조상훈
|
11년 전 | 1480 | |
| 6974 |
잘살아보자
|
11년 전 | 2231 | |
| 6973 |
잘살아보자
|
11년 전 | 1157 | |
| 6972 |
잘살아보자
|
11년 전 | 3068 | |
| 6971 |
잘살아보자
|
11년 전 | 3275 | |
| 6970 |
잘살아보자
|
11년 전 | 1843 | |
| 6969 |
잘살아보자
|
11년 전 | 4770 | |
| 6968 | 11년 전 | 9902 | ||
| 6967 |
|
11년 전 | 2639 | |
| 6966 |
|
11년 전 | 1112 | |
| 6965 | 11년 전 | 3259 | ||
| 6964 | 11년 전 | 2583 | ||
| 6963 | 11년 전 | 2101 | ||
| 6962 |
star3840
|
11년 전 | 1015 | |
| 6961 | 11년 전 | 4244 | ||
| 6960 |
|
11년 전 | 724 | |
| 6959 | 11년 전 | 1248 | ||
| 6958 |
|
11년 전 | 1675 | |
| 6957 | 11년 전 | 1897 | ||
| 6956 |
잘살아보자
|
11년 전 | 1851 | |
| 6955 | 11년 전 | 4628 | ||
| 6954 | 11년 전 | 1628 | ||
| 6953 |
잘살아보자
|
11년 전 | 864 | |
| 6952 |
잘살아보자
|
11년 전 | 2048 | |
| 6951 | 11년 전 | 1612 | ||
| 6950 | 11년 전 | 2613 | ||
| 6949 |
잘살아보자
|
11년 전 | 884 | |
| 6948 | 11년 전 | 1555 | ||
| 6947 | 11년 전 | 1465 | ||
| 6946 | 11년 전 | 1610 | ||
| 6945 | 11년 전 | 1229 | ||
| 6944 | 11년 전 | 1190 | ||
| 6943 | 11년 전 | 1232 | ||
| 6942 | 11년 전 | 1582 | ||
| 6941 | 11년 전 | 1656 | ||
| 6940 | 11년 전 | 1755 | ||
| 6939 | 11년 전 | 1667 | ||
| 6938 | 11년 전 | 1945 | ||
| 6937 | 11년 전 | 1152 | ||
| 6936 | 11년 전 | 1349 | ||
| 6935 | 11년 전 | 1299 | ||
| 6934 | 11년 전 | 1469 | ||
| 6933 | 11년 전 | 1980 | ||
| 6932 | 11년 전 | 1533 | ||
| 6931 | 11년 전 | 1535 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기