Add: Email validator

This commit is contained in:
2018-12-22 18:18:09 +09:00
parent bebde27337
commit 618bc4453a
2 changed files with 27 additions and 2 deletions
+15
View File
@@ -6,6 +6,8 @@ function AccountValidator() {
this.patternPlayerPW = /^[0-9]{2,8}$/;
this.patternLicenseTimerPW = /^[0-9]{2,8}$/;
this.patternEmailAddress = /([a-zA-Z0-9]+)([+\_\.\-{1}])?([a-zA-Z0-9]+)\@([a-zA-Z0-9]+)([\.])([a-zA-Z\.]+)/;
}
@@ -104,6 +106,19 @@ AccountValidator.prototype.messageForInvalidLicenseTimerPassword = function(text
}
// email ID
AccountValidator.prototype.isValidEmailAddress = function(email) {
if(!this.patternEmailAddress.test(email))
return false;
return true;
}
AccountValidator.prototype.messageForInvalidEmailAddress = function(email) {
return "유효하지 않은 이메일 주소입니다. 올바른 이메일 주소를 입력해주세요.";
}
AccountValidator.MAESTRO_ID_LENGTH_MINIMUM = 4;