중복확인을 일일이 짜는게 귀찮아서... 아래처럼 해버렸네요 ㅎㅎㅎ
날이 갈수록 꼼수만 늘어 가는 것 같습니다.
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입니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7230 | 11년 전 | 3598 | ||
| 7229 | 11년 전 | 3723 | ||
| 7228 | 11년 전 | 3777 | ||
| 7227 | 11년 전 | 3905 | ||
| 7226 | 11년 전 | 2359 | ||
| 7225 | 11년 전 | 17433 | ||
| 7224 |
AngryDev
|
11년 전 | 1341 | |
| 7223 |
돌아온깡통
|
11년 전 | 1086 | |
| 7222 |
돌아온깡통
|
11년 전 | 1027 | |
| 7221 |
돌아온깡통
|
11년 전 | 865 | |
| 7220 |
돌아온깡통
|
11년 전 | 985 | |
| 7219 |
돌아온깡통
|
11년 전 | 810 | |
| 7218 |
돌아온깡통
|
11년 전 | 653 | |
| 7217 |
돌아온깡통
|
11년 전 | 1041 | |
| 7216 |
돌아온깡통
|
11년 전 | 782 | |
| 7215 |
돌아온깡통
|
11년 전 | 696 | |
| 7214 |
돌아온깡통
|
11년 전 | 1040 | |
| 7213 |
돌아온깡통
|
11년 전 | 906 | |
| 7212 |
돌아온깡통
|
11년 전 | 700 | |
| 7211 |
돌아온깡통
|
11년 전 | 856 | |
| 7210 |
돌아온깡통
|
11년 전 | 878 | |
| 7209 |
돌아온깡통
|
11년 전 | 881 | |
| 7208 |
돌아온깡통
|
11년 전 | 985 | |
| 7207 |
돌아온깡통
|
11년 전 | 620 | |
| 7206 |
돌아온깡통
|
11년 전 | 667 | |
| 7205 |
돌아온깡통
|
11년 전 | 853 | |
| 7204 |
돌아온깡통
|
11년 전 | 711 | |
| 7203 |
돌아온깡통
|
11년 전 | 735 | |
| 7202 |
돌아온깡통
|
11년 전 | 699 | |
| 7201 |
돌아온깡통
|
11년 전 | 639 | |
| 7200 |
돌아온깡통
|
11년 전 | 695 | |
| 7199 |
돌아온깡통
|
11년 전 | 1306 | |
| 7198 |
돌아온깡통
|
11년 전 | 640 | |
| 7197 |
돌아온깡통
|
11년 전 | 954 | |
| 7196 |
돌아온깡통
|
11년 전 | 843 | |
| 7195 |
돌아온깡통
|
11년 전 | 586 | |
| 7194 |
돌아온깡통
|
11년 전 | 617 | |
| 7193 |
돌아온깡통
|
11년 전 | 690 | |
| 7192 |
돌아온깡통
|
11년 전 | 709 | |
| 7191 |
joe031
|
11년 전 | 1243 | |
| 7190 | 11년 전 | 4126 | ||
| 7189 | 11년 전 | 1202 | ||
| 7188 |
잘살아보자
|
11년 전 | 927 | |
| 7187 | 11년 전 | 1404 | ||
| 7186 |
kiplayer
|
11년 전 | 7529 | |
| 7185 | 11년 전 | 1118 | ||
| 7184 |
잘살아보자
|
11년 전 | 2325 | |
| 7183 |
잘살아보자
|
11년 전 | 1138 | |
| 7182 |
잘살아보자
|
11년 전 | 1190 | |
| 7181 | 11년 전 | 1472 | ||
| 7180 |
하얀비요일
|
11년 전 | 977 | |
| 7179 |
잘살아보자
|
11년 전 | 978 | |
| 7178 | 11년 전 | 975 | ||
| 7177 | 11년 전 | 987 | ||
| 7176 | 11년 전 | 1650 | ||
| 7175 |
|
11년 전 | 1034 | |
| 7174 |
kiplayer
|
11년 전 | 1169 | |
| 7173 | 11년 전 | 953 | ||
| 7172 |
잘살아보자
|
11년 전 | 4632 | |
| 7171 |
잘살아보자
|
11년 전 | 687 | |
| 7170 | 11년 전 | 1060 | ||
| 7169 |
초심의설렘
|
11년 전 | 1461 | |
| 7168 | 11년 전 | 995 | ||
| 7167 |
잘살아보자
|
11년 전 | 5279 | |
| 7166 |
잘살아보자
|
11년 전 | 3404 | |
| 7165 | 11년 전 | 4945 | ||
| 7164 | 11년 전 | 821 | ||
| 7163 | 11년 전 | 1178 | ||
| 7162 |
울라라라우
|
11년 전 | 1361 | |
| 7161 | 11년 전 | 1243 | ||
| 7160 |
skyler
|
11년 전 | 1178 | |
| 7159 |
|
11년 전 | 671 | |
| 7158 |
|
11년 전 | 3330 | |
| 7157 |
잘살아보자
|
11년 전 | 2877 | |
| 7156 |
잘살아보자
|
11년 전 | 2216 | |
| 7155 |
잘살아보자
|
11년 전 | 1443 | |
| 7154 |
잘살아보자
|
11년 전 | 1444 | |
| 7153 | 11년 전 | 2871 | ||
| 7152 |
울라라라우
|
11년 전 | 818 | |
| 7151 | 11년 전 | 1042 | ||
| 7150 |
잘살아보자
|
11년 전 | 2376 | |
| 7149 |
잘살아보자
|
11년 전 | 3284 | |
| 7148 |
잘살아보자
|
11년 전 | 1178 | |
| 7147 |
잘살아보자
|
11년 전 | 749 | |
| 7146 |
잘살아보자
|
11년 전 | 1386 | |
| 7145 |
잘살아보자
|
11년 전 | 697 | |
| 7144 |
잘살아보자
|
11년 전 | 1276 | |
| 7143 |
잘살아보자
|
11년 전 | 739 | |
| 7142 |
잘살아보자
|
11년 전 | 1437 | |
| 7141 |
잘살아보자
|
11년 전 | 1189 | |
| 7140 |
잘살아보자
|
11년 전 | 1987 | |
| 7139 |
잘살아보자
|
11년 전 | 3655 | |
| 7138 |
잘살아보자
|
11년 전 | 3152 | |
| 7137 |
잘살아보자
|
11년 전 | 3619 | |
| 7136 |
잘살아보자
|
11년 전 | 1375 | |
| 7135 |
gooroo
|
11년 전 | 1605 | |
| 7134 |
열라뽕똬이
|
11년 전 | 2306 | |
| 7133 |
|
11년 전 | 1011 | |
| 7132 | 11년 전 | 1424 | ||
| 7131 | 11년 전 | 3564 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기