validation.js
1.72 KB
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
var Email={
checkEmailForm:function(email){
var regExp = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i;
if(regExp.test(email){
return true;
}else return false;
}
,
checkEmpty:function(self){
var putEmail=document.getElementById('eValidation').value;
if(Email.checkEmailForm(putEmail)===true){
return true;
}else {
if(Email.checkEmailForm(putEmail)===NULL)
alert("Email을 입력하세요.");
else alert("Email 형식을 확인해주세요.");
}
}
}
var Password={
checkPasswordfs:function(self){
var fpassword=document.getElementById('fValidation').value;
var spassword= document.getElementById('sValidation').value;
if(fpassword===spassword){
return true;
}else return false;
}
,
checkEmpty:function(self){
var fpassword=document.getElementById('fValidation').value;
var spassword= document.getElementById('sValidation').value;
if(fpassword===NULL || spassword===NULL){
alert("비밀번호를 입력해주세요");
}else {
return true;
}
}
,
}
function validationCheck(self) {
if(Password.checkPasswordfs()){
Password.checkEmpty();
}else alert("두 비밀번호가 일치하지 않습니다! 다시 입력해주세요!");
}
function nightDayHandler(self){
if(self.value==='night')
{
Body.SetBackGruondColor('black')
Body.SetColor('white');
self.value= 'day';
Links.SetColor('powderblue');
}else{
Body.SetBackGruondColor('white')
Body.SetColor('black');
self.value= 'night';
Links.SetColor('blue');
}
}