중복확인을 일일이 짜는게 귀찮아서... 아래처럼 해버렸네요 ㅎㅎㅎ
날이 갈수록 꼼수만 늘어 가는 것 같습니다.
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입니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6830 |
112211dd
|
11년 전 | 787 | |
| 6829 |
진짜다진짜가나타남
|
11년 전 | 1185 | |
| 6828 | 11년 전 | 817 | ||
| 6827 |
봉보로봉봉
|
11년 전 | 897 | |
| 6826 |
jinion
|
11년 전 | 814 | |
| 6825 | 11년 전 | 797 | ||
| 6824 |
yunkiri486
|
11년 전 | 712 | |
| 6823 |
2donggalbi
|
11년 전 | 847 | |
| 6822 | 11년 전 | 843 | ||
| 6821 | 11년 전 | 793 | ||
| 6820 | 11년 전 | 3098 | ||
| 6819 | 11년 전 | 1248 | ||
| 6818 | 11년 전 | 513 | ||
| 6817 |
|
11년 전 | 600 | |
| 6816 | 11년 전 | 2070 | ||
| 6815 | 11년 전 | 1205 | ||
| 6814 | 11년 전 | 851 | ||
| 6813 | 11년 전 | 598 | ||
| 6812 |
|
11년 전 | 979 | |
| 6811 | 11년 전 | 574 | ||
| 6810 | 11년 전 | 1534 | ||
| 6809 |
낚시가좋아
|
11년 전 | 1043 | |
| 6808 | 11년 전 | 436 | ||
| 6807 | 11년 전 | 757 | ||
| 6806 |
Unhappy
|
11년 전 | 1766 | |
| 6805 | 11년 전 | 1589 | ||
| 6804 | 11년 전 | 1113 | ||
| 6803 | 11년 전 | 550 | ||
| 6802 |
asdfg
|
11년 전 | 1130 | |
| 6801 |
아트귀농인
|
11년 전 | 497 | |
| 6800 | 11년 전 | 2550 | ||
| 6799 | 11년 전 | 1351 | ||
| 6798 | 11년 전 | 1466 | ||
| 6797 | 11년 전 | 622 | ||
| 6796 |
purple63
|
11년 전 | 424 | |
| 6795 | 11년 전 | 2630 | ||
| 6794 |
커네드커네드
|
11년 전 | 953 | |
| 6793 | 11년 전 | 398 | ||
| 6792 | 11년 전 | 2486 | ||
| 6791 | 11년 전 | 503 | ||
| 6790 | 11년 전 | 2248 | ||
| 6789 |
리아빌리티
|
11년 전 | 3090 | |
| 6788 | 11년 전 | 1341 | ||
| 6787 | 11년 전 | 670 | ||
| 6786 | 11년 전 | 386 | ||
| 6785 | 11년 전 | 714 | ||
| 6784 |
|
11년 전 | 837 | |
| 6783 | 11년 전 | 577 | ||
| 6782 | 11년 전 | 3651 | ||
| 6781 |
리아빌리티
|
11년 전 | 476 | |
| 6780 | 11년 전 | 517 | ||
| 6779 | 11년 전 | 474 | ||
| 6778 | 11년 전 | 4674 | ||
| 6777 |
바보온달123
|
11년 전 | 606 | |
| 6776 | 11년 전 | 921 | ||
| 6775 | 11년 전 | 722 | ||
| 6774 |
DANet
|
11년 전 | 631 | |
| 6773 | 11년 전 | 1557 | ||
| 6772 | 11년 전 | 1349 | ||
| 6771 | 11년 전 | 609 | ||
| 6770 | 11년 전 | 1153 | ||
| 6769 | 11년 전 | 943 | ||
| 6768 | 11년 전 | 680 | ||
| 6767 | 11년 전 | 575 | ||
| 6766 | 11년 전 | 1258 | ||
| 6765 |
크림나이트
|
11년 전 | 988 | |
| 6764 | 11년 전 | 1530 | ||
| 6763 | 11년 전 | 2590 | ||
| 6762 | 11년 전 | 522 | ||
| 6761 |
|
11년 전 | 777 | |
| 6760 |
|
11년 전 | 705 | |
| 6759 | 11년 전 | 3337 | ||
| 6758 | 11년 전 | 1004 | ||
| 6757 | 11년 전 | 1264 | ||
| 6756 | 11년 전 | 887 | ||
| 6755 |
|
11년 전 | 566 | |
| 6754 |
|
11년 전 | 708 | |
| 6753 |
|
11년 전 | 1373 | |
| 6752 | 11년 전 | 597 | ||
| 6751 |
|
11년 전 | 646 | |
| 6750 |
|
11년 전 | 2012 | |
| 6749 | 11년 전 | 1205 | ||
| 6748 |
|
11년 전 | 1109 | |
| 6747 | 11년 전 | 1154 | ||
| 6746 | 11년 전 | 826 | ||
| 6745 |
|
11년 전 | 902 | |
| 6744 | 11년 전 | 845 | ||
| 6743 | 11년 전 | 1272 | ||
| 6742 | 11년 전 | 524 | ||
| 6741 |
Abilityarch
|
11년 전 | 598 | |
| 6740 | 11년 전 | 637 | ||
| 6739 |
leewin20
|
11년 전 | 1226 | |
| 6738 | 11년 전 | 500 | ||
| 6737 | 11년 전 | 1210 | ||
| 6736 | 11년 전 | 1247 | ||
| 6735 | 11년 전 | 543 | ||
| 6734 | 11년 전 | 1277 | ||
| 6733 |
RipperTNT
|
11년 전 | 1835 | |
| 6732 |
|
11년 전 | 1333 | |
| 6731 |
|
11년 전 | 1383 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기