MinsoftK

create about login validation(Email From and Password )

......@@ -4,7 +4,7 @@
<title>KHU KHU Chat</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<script src="validation.js"></script>
</head>
<body>
......@@ -26,13 +26,13 @@
<div id="inputset">
<form class="signinform" action="loginmain.html">
<label for="email">이메일:</label><br>
<input type="text" name="email" placeholder="이메일을 입력하세요."><br>
<input id="eValidation"type="text" name="email" placeholder="이메일을 입력하세요."><br>
<label for="password">비밀번호:</label><br>
<input type="password" name="password" placeholder="비밀번호를 입력하세요."><br>
<input id="fValidation" type="password" name="password" placeholder="비밀번호를 입력하세요."><br>
<label for="password">비밀번호 확인:</label><br>
<input type="password" name="checkpassword" placeholder="비밀번호를 입력하세요."><br>
<input id="sValidation" type="password" name="checkpassword" placeholder="비밀번호를 입력하세요."><br>
<label for="name">이름:</label><br>
......
function
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');
}
}
......