validation.js 1.72 KB
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');
    }
  }