중복확인을 일일이 짜는게 귀찮아서... 아래처럼 해버렸네요 ㅎㅎㅎ
날이 갈수록 꼼수만 늘어 가는 것 같습니다.
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입니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 330 |
prosper
|
20년 전 | 2247 | |
| 329 |
prosper
|
20년 전 | 1858 | |
| 328 |
prosper
|
20년 전 | 1670 | |
| 327 | 20년 전 | 3748 | ||
| 326 | 20년 전 | 4825 | ||
| 325 |
hwatta
|
20년 전 | 2453 | |
| 324 |
|
20년 전 | 3122 | |
| 323 | 20년 전 | 5833 | ||
| 322 |
hwatta
|
20년 전 | 2824 | |
| 321 |
hwatta
|
20년 전 | 2300 | |
| 320 |
yesmoa
|
20년 전 | 4559 | |
| 319 | 20년 전 | 2660 | ||
| 318 | 20년 전 | 2229 | ||
| 317 |
kyodon
|
20년 전 | 2753 | |
| 316 | 20년 전 | 2559 | ||
| 315 |
|
20년 전 | 2869 | |
| 314 |
|
20년 전 | 3317 | |
| 313 |
|
20년 전 | 2626 | |
| 312 |
yesmoa
|
20년 전 | 4700 | |
| 311 | 20년 전 | 3236 | ||
| 310 |
홀로남은자
|
20년 전 | 4543 | |
| 309 | 20년 전 | 2997 | ||
| 308 | 20년 전 | 4111 | ||
| 307 | 20년 전 | 4342 | ||
| 306 | 20년 전 | 7015 | ||
| 305 | 20년 전 | 3856 | ||
| 304 | 20년 전 | 2745 | ||
| 303 |
크리스탈처럼
|
20년 전 | 4382 | |
| 302 | 20년 전 | 2192 | ||
| 301 |
|
20년 전 | 4311 | |
| 300 | 20년 전 | 3772 | ||
| 299 | 20년 전 | 2582 | ||
| 298 | 20년 전 | 4808 | ||
| 297 |
|
20년 전 | 2512 | |
| 296 | 20년 전 | 4506 | ||
| 295 | 20년 전 | 3555 | ||
| 294 | 20년 전 | 3578 | ||
| 293 | 20년 전 | 3806 | ||
| 292 | 20년 전 | 3191 | ||
| 291 |
yesmoa
|
20년 전 | 5911 | |
| 290 | 20년 전 | 2928 | ||
| 289 | 20년 전 | 5831 | ||
| 288 |
|
20년 전 | 2359 | |
| 287 |
|
20년 전 | 1774 | |
| 286 |
|
20년 전 | 2129 | |
| 285 |
|
20년 전 | 3525 | |
| 284 |
|
20년 전 | 2025 | |
| 283 |
|
20년 전 | 4393 | |
| 282 | 20년 전 | 3373 | ||
| 281 |
|
20년 전 | 2193 | |
| 280 |
|
20년 전 | 7789 | |
| 279 | 20년 전 | 5529 | ||
| 278 | 20년 전 | 2976 | ||
| 277 |
|
20년 전 | 5561 | |
| 276 | 20년 전 | 2347 | ||
| 275 | 20년 전 | 2589 | ||
| 274 | 20년 전 | 2357 | ||
| 273 | 20년 전 | 2204 | ||
| 272 | 20년 전 | 2129 | ||
| 271 | 20년 전 | 2590 | ||
| 270 | 20년 전 | 2597 | ||
| 269 | 20년 전 | 2469 | ||
| 268 | 20년 전 | 2666 | ||
| 267 | 20년 전 | 2352 | ||
| 266 | 20년 전 | 2557 | ||
| 265 | 20년 전 | 3486 | ||
| 264 |
|
20년 전 | 5344 | |
| 263 |
|
20년 전 | 3707 | |
| 262 | 20년 전 | 3160 | ||
| 261 |
허저비
|
20년 전 | 5910 | |
| 260 |
|
20년 전 | 5705 | |
| 259 | 20년 전 | 4125 | ||
| 258 | 20년 전 | 2366 | ||
| 257 | 20년 전 | 3173 | ||
| 256 | 20년 전 | 1891 | ||
| 255 | 20년 전 | 1552 | ||
| 254 | 20년 전 | 3128 | ||
| 253 | 20년 전 | 3536 | ||
| 252 | 20년 전 | 5102 | ||
| 251 | 20년 전 | 5795 | ||
| 250 | 20년 전 | 3666 | ||
| 249 | 20년 전 | 5003 | ||
| 248 | 20년 전 | 3272 | ||
| 247 | 20년 전 | 3624 | ||
| 246 |
|
20년 전 | 7934 | |
| 245 |
|
20년 전 | 5890 | |
| 244 | 20년 전 | 4472 | ||
| 243 |
|
20년 전 | 4036 | |
| 242 | 20년 전 | 2762 | ||
| 241 | 20년 전 | 2704 | ||
| 240 | 20년 전 | 2344 | ||
| 239 | 20년 전 | 1641 | ||
| 238 |
아우겐나이스
|
20년 전 | 2245 | |
| 237 |
email
|
20년 전 | 3671 | |
| 236 | 20년 전 | 4132 | ||
| 235 | 20년 전 | 10453 | ||
| 234 | 20년 전 | 5048 | ||
| 233 | 20년 전 | 3358 | ||
| 232 | 20년 전 | 3185 | ||
| 231 | 20년 전 | 3821 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기