Merge pull request #41 from danieldupriest/validate-email

validate email
This commit is contained in:
Daniel Dupriest 2019-01-27 11:09:37 -08:00 committed by GitHub
commit 546c83f6f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -9,4 +9,12 @@ function validatePassword(){
}
}
password.onchange = validatePassword;
confirm_password.onkeyup = validatePassword;
confirm_password.onkeyup = validatePassword;
function validateEmail(email)
{
if(email.validity.patternMismatch)
email.setCustomValidity('Please input correct email');
else
email.setCustomValidity('');
}

View file

@ -29,7 +29,7 @@
</div>
<div class="form-group">
<label for="email">Email:</label>
<input class="form-control" type="email" id="email" required>
<input class="form-control" type="email" id="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" oninput="validateEmail(this);" required>
</div>
<div class="form-group">
<label for="password">Password:</label>