MinsoftK

create about login validation(Email From and Password )

...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 <title>KHU KHU Chat</title> 4 <title>KHU KHU Chat</title>
5 <meta charset="utf-8"> 5 <meta charset="utf-8">
6 <link rel="stylesheet" href="style.css"> 6 <link rel="stylesheet" href="style.css">
7 - 7 +<script src="validation.js"></script>
8 8
9 </head> 9 </head>
10 <body> 10 <body>
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
26 <div id="inputset"> 26 <div id="inputset">
27 <form class="signinform" action="loginmain.html"> 27 <form class="signinform" action="loginmain.html">
28 <label for="email">이메일:</label><br> 28 <label for="email">이메일:</label><br>
29 - <input type="text" name="email" placeholder="이메일을 입력하세요."><br> 29 + <input id="eValidation"type="text" name="email" placeholder="이메일을 입력하세요."><br>
30 30
31 <label for="password">비밀번호:</label><br> 31 <label for="password">비밀번호:</label><br>
32 - <input type="password" name="password" placeholder="비밀번호를 입력하세요."><br> 32 + <input id="fValidation" type="password" name="password" placeholder="비밀번호를 입력하세요."><br>
33 33
34 <label for="password">비밀번호 확인:</label><br> 34 <label for="password">비밀번호 확인:</label><br>
35 - <input type="password" name="checkpassword" placeholder="비밀번호를 입력하세요."><br> 35 + <input id="sValidation" type="password" name="checkpassword" placeholder="비밀번호를 입력하세요."><br>
36 36
37 37
38 <label for="name">이름:</label><br> 38 <label for="name">이름:</label><br>
......
1 -function 1 +var Email={
2 + checkEmailForm:function(email){
3 + var regExp = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i;
4 + if(regExp.test(email){
5 + return true;
6 + }else return false;
7 + }
8 + ,
9 + checkEmpty:function(self){
10 + var putEmail=document.getElementById('eValidation').value;
11 + if(Email.checkEmailForm(putEmail)===true){
12 + return true;
13 + }else {
14 + if(Email.checkEmailForm(putEmail)===NULL)
15 + alert("Email을 입력하세요.");
16 + else alert("Email 형식을 확인해주세요.");
17 + }
18 + }
19 +}
20 +
21 +var Password={
22 + checkPasswordfs:function(self){
23 + var fpassword=document.getElementById('fValidation').value;
24 + var spassword= document.getElementById('sValidation').value;
25 + if(fpassword===spassword){
26 + return true;
27 + }else return false;
28 + }
29 + ,
30 + checkEmpty:function(self){
31 + var fpassword=document.getElementById('fValidation').value;
32 + var spassword= document.getElementById('sValidation').value;
33 + if(fpassword===NULL || spassword===NULL){
34 + alert("비밀번호를 입력해주세요");
35 + }else {
36 + return true;
37 + }
38 + }
39 + ,
40 +
41 +}
42 +
43 +function validationCheck(self) {
44 + if(Password.checkPasswordfs()){
45 + Password.checkEmpty();
46 + }else alert("두 비밀번호가 일치하지 않습니다! 다시 입력해주세요!");
47 +}
48 +
49 +function nightDayHandler(self){
50 + if(self.value==='night')
51 + {
52 + Body.SetBackGruondColor('black')
53 + Body.SetColor('white');
54 + self.value= 'day';
55 +
56 + Links.SetColor('powderblue');
57 +
58 + }else{
59 + Body.SetBackGruondColor('white')
60 + Body.SetColor('black');
61 + self.value= 'night';
62 +
63 + Links.SetColor('blue');
64 + }
65 + }
......