700===Dev Project/기본 게시판

매우 기초적인 회원가입시 공백 검증(Validation)

블로글러 2019. 1. 17. 14:22

회원가입 .jsp 파일에 추가해야한다. 


register.jsp


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<html>
<script language="javascript">
      function check() {
 
        var f = document.Reg_form; 
    
 
        if (f.MEMBER_ID.value == "") {
            alert("아이디를 입력해주십시오");
            f.MEMBER_ID.focus();
            return false;
        }
 
        if (f.PASSWD.value == "") {
            alert("비밀번호를 입력해주십시오");
            f.PASSWD.focus();
            
            return false;
        }
 
        if (f.PASSWD.value != f.PASSWD2.value) {
            alert("비빌번호를 다르게 입력했습니다.");
            f.PASSWD2.select();
            return false;
        }
 
        if (f.NAME.value == "") {
            alert("이름을 입력해주십시오");
            f.NAME.focus();
            return false;
        }
 
        if (f.BRITH.value == "") {
            alert("주민등록번호를 입력해주십시오");
            f.BIRTH.focus();
            return false;
        }
 
        if (f.ZIPCODE.value == "") {
            alert("우편번호를 검색하여 입력해주십시오");
            f.ZIPCODE.focus();
            return false;
        }
 
        if (f.ADDR1.value == "") {
            alert("기본주소를 입력해주십시오");
            f.ADDR1.focus();
            return false;
        }
 
        if (f.ADDR2.value == "") {
            alert("상세주소를 입력해주십시오");
            f.ADDR2.focus();
            return false;
        }
 
        if (f.PHONE.value == "") {
            alert("전화번호를 입력해주십시오");
            f.PHONE.focus();
            return false;
        }
 
 
        if (f.EMAIL.value == "") {
            alert("이메일을 입력해주십시오");
            f.EMAIL.focus();
            return false;
        }
        
            
    }   
 
      function openConfirmId(){
            var url="/checkId?MEMBER_ID="+ document.Reg_form.MEMBER_ID.value;
            var chk=document.Reg_form;
            if(chk.MEMBER_ID.value==""){
                alert("ID를 입력하세요");
                chk.MEMBER_ID.focus();
                return false;
            }
            if (chk.MEMBER_ID.value.length < 2) {
                alert("최소 2자리 이상 입력해주세요!");
                chk.MEMBER_ID.focus();
                return false;
            }
            open(url, "confirm""toolbar=no,location=no,status=no,menubar=no,"+
                                 "scrollbars=no,resizable=no,width=400,height=200");
        }
</script>
cs



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<form name="Reg_form" action="/member/register" method="post" onsubmit="return check()">
                    <table>
                        <tr>
                            <td>회원가입</td>
                        </tr>
                        <tr>
                            <td>아이디</td>
                            <td valign="middle">
                                <input type="text" name="MEMBER_ID" id="MEMBER_ID" maxlength="20"size="28" onkeyup="javascript:keyevent(this);">
                                <input type="button" name="confirMEMBER_ID"    value="중복확인" onclick="over()" >
                                <input type="hidden" name="confirMEMBER_ID" value=""> 영문/숫자를이용하여 4~12자로 입력하세요
                            </td>
                        </tr>
                        <tr>
                            <td>비밀번호</td>
                            <td valign="middle"><input type="password" maxlength="14"
                                name="PASSWD" size="30"> 영문/숫자를 이용하여 4~12자로 입력하세요</td>
                        </tr>
                        <tr>
                            <td>비밀번호확인</td>
                            <td valign="middle"><input type="password"  maxlength="14"
                                name="PASSWD2" size="30"> 비밀번호를 재입력 해주세요</td>
                        </tr>
                        <tr>
                            <td>이 름</td>
                            <td valign="middle"><input type="text" name="NAME"
                                size="28"> 회원가입 후 수정이 불가능합니다</td>
                        </tr>
                        <tr>
                            <td>주민등록번호</td>
                            <td valign="middle"><input type="text" name="BIRTH" 
                                size="16" maxlength="8">
                        </tr>
                        <tr>
                            <td>우편번호</td>
                            <td valign="middle"><input type="text" id="ZIPCODE"
                                name="ZIPCODE" size="28" placeholder="검색버튼이용해주세요">
                                <input type="button" value="검색" onclick="DaumPostcode()"
                                class="hreflink2"> <br></td>
                        </tr>
                        <tr>
                            <td>주 소</td>
                            <td valign="middle"><input type="text" id="ADDR1"
                                name="ADDR1" placeholder="자동기입" size="60"> <br>
                                <input type="text" id="ADDR2" name="ADDR2" placeholder="상제주소를 입력해주세요"size="60"></td>
                        </tr>
 
                        <tr>
                            <td class="tdstyle1">휴대폰번호</td>
                            <td valign="middle"><input type="text" name="PHONE" maxlength="11"
                                size="28" placeholder="ex)01055551111"> "-" 없이 숫자만 입력하세요</td>
                        </tr>
                        <tr>
                            <td class="tdstyle1">이메일</td>
                            <td valign="middle">
                                    <input name="EMAIL1" type="text" class="box" id="EMAIL1"
                                        size="15"> @ <input name="EMAIL2" type="text"
                                        class="box" id="EMAIL2" size="20"> <select
                                        name="email3"  id="email_select"
                                        onChange="checkemailaddy();">
                                        <option value="" selected>선택하세요</option>
                                        <option value="naver.com">naver.com</option>
                                        <option value="hotmail.com">hotmail.com</option>
                                        <option value="hanmail.com">hanmail.com</option>
                                        <option value="yahoo.co.kr">yahoo.co.kr</option>
                                        <option value="1">직접입력</option>
                                    </select>
                            </td>
 
                        </table>
                                
                        </tr>
                        
                        <p><p><p>
                        
                        <tr>
                            <td colspan="2" align="center" style="border: 0px;">
                                <input type="submit" value="회원가입"> 
                                <input type="button" value="취 소" onclick='location.href="/main"'></td>
                        </tr>
 
                    </table>            
 
                    </form>
</html>
cs


728x90

'700===Dev Project > 기본 게시판' 카테고리의 다른 글

자동 로그인 처리  (0) 2019.01.17
회원가입  (0) 2019.01.14