중복확인을 일일이 짜는게 귀찮아서... 아래처럼 해버렸네요 ㅎㅎㅎ
날이 갈수록 꼼수만 늘어 가는 것 같습니다.
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입니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6930 |
SOFTA
|
11년 전 | 5974 | |
| 6929 |
|
11년 전 | 1589 | |
| 6928 | 11년 전 | 1749 | ||
| 6927 | 11년 전 | 1770 | ||
| 6926 | 11년 전 | 1868 | ||
| 6925 | 11년 전 | 2267 | ||
| 6924 | 11년 전 | 3866 | ||
| 6923 | 11년 전 | 2257 | ||
| 6922 |
level999
|
11년 전 | 1025 | |
| 6921 | 11년 전 | 810 | ||
| 6920 | 11년 전 | 944 | ||
| 6919 | 11년 전 | 1054 | ||
| 6918 | 11년 전 | 1310 | ||
| 6917 | 11년 전 | 15425 | ||
| 6916 | 11년 전 | 1424 | ||
| 6915 | 11년 전 | 571 | ||
| 6914 | 11년 전 | 599 | ||
| 6913 | 11년 전 | 874 | ||
| 6912 | 11년 전 | 3125 | ||
| 6911 |
사랑해요79
|
11년 전 | 960 | |
| 6910 | 11년 전 | 739 | ||
| 6909 | 11년 전 | 775 | ||
| 6908 | 11년 전 | 634 | ||
| 6907 | 11년 전 | 827 | ||
| 6906 | 11년 전 | 1582 | ||
| 6905 | 11년 전 | 560 | ||
| 6904 | 11년 전 | 995 | ||
| 6903 | 11년 전 | 1669 | ||
| 6902 |
2donggalbi
|
11년 전 | 510 | |
| 6901 | 11년 전 | 1379 | ||
| 6900 | 11년 전 | 709 | ||
| 6899 | 11년 전 | 853 | ||
| 6898 |
열라뽕똬이
|
11년 전 | 1302 | |
| 6897 |
this1mg
|
11년 전 | 1593 | |
| 6896 |
sbdossb
|
11년 전 | 567 | |
| 6895 |
봉보로봉봉
|
11년 전 | 1141 | |
| 6894 |
똘똘이스머츠
|
11년 전 | 489 | |
| 6893 |
네이비컬러
|
11년 전 | 3638 | |
| 6892 | 11년 전 | 1070 | ||
| 6891 |
네이비컬러
|
11년 전 | 1313 | |
| 6890 | 11년 전 | 1136 | ||
| 6889 | 11년 전 | 580 | ||
| 6888 | 11년 전 | 714 | ||
| 6887 | 11년 전 | 605 | ||
| 6886 | 11년 전 | 5052 | ||
| 6885 | 11년 전 | 546 | ||
| 6884 |
asfasdfd235
|
11년 전 | 562 | |
| 6883 | 11년 전 | 3026 | ||
| 6882 | 11년 전 | 887 | ||
| 6881 | 11년 전 | 4414 | ||
| 6880 | 11년 전 | 1803 | ||
| 6879 |
퍼블리셔지노군
|
11년 전 | 2614 | |
| 6878 | 11년 전 | 545 | ||
| 6877 | 11년 전 | 568 | ||
| 6876 | 11년 전 | 1441 | ||
| 6875 | 11년 전 | 625 | ||
| 6874 | 11년 전 | 1598 | ||
| 6873 | 11년 전 | 1586 | ||
| 6872 | 11년 전 | 4451 | ||
| 6871 |
Abilityarch
|
11년 전 | 959 | |
| 6870 | 11년 전 | 2119 | ||
| 6869 | 11년 전 | 1403 | ||
| 6868 | 11년 전 | 1437 | ||
| 6867 | 11년 전 | 1516 | ||
| 6866 | 11년 전 | 741 | ||
| 6865 | 11년 전 | 1614 | ||
| 6864 | 11년 전 | 463 | ||
| 6863 | 11년 전 | 3743 | ||
| 6862 | 11년 전 | 1845 | ||
| 6861 | 11년 전 | 1641 | ||
| 6860 | 11년 전 | 1281 | ||
| 6859 |
cityman
|
11년 전 | 6805 | |
| 6858 | 11년 전 | 1253 | ||
| 6857 |
의정부아줌마
|
11년 전 | 855 | |
| 6856 | 11년 전 | 2360 | ||
| 6855 | 11년 전 | 1694 | ||
| 6854 | 11년 전 | 819 | ||
| 6853 | 11년 전 | 1205 | ||
| 6852 | 11년 전 | 2590 | ||
| 6851 | 11년 전 | 1955 | ||
| 6850 | 11년 전 | 1784 | ||
| 6849 | 11년 전 | 2072 | ||
| 6848 | 11년 전 | 2352 | ||
| 6847 | 11년 전 | 3125 | ||
| 6846 | 11년 전 | 2712 | ||
| 6845 | 11년 전 | 2799 | ||
| 6844 | 11년 전 | 3507 | ||
| 6843 | 11년 전 | 3259 | ||
| 6842 |
아트291
|
11년 전 | 685 | |
| 6841 | 11년 전 | 4166 | ||
| 6840 | 11년 전 | 5180 | ||
| 6839 | 11년 전 | 886 | ||
| 6838 |
|
11년 전 | 2093 | |
| 6837 | 11년 전 | 1272 | ||
| 6836 |
netdf
|
11년 전 | 605 | |
| 6835 |
|
11년 전 | 1001 | |
| 6834 | 11년 전 | 665 | ||
| 6833 |
|
11년 전 | 2673 | |
| 6832 |
울산굿모닝
|
11년 전 | 1650 | |
| 6831 |
|
11년 전 | 663 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기