Merge pull request #41 from danieldupriest/validate-email
validate email
This commit is contained in:
commit
546c83f6f8
2 changed files with 10 additions and 2 deletions
|
@ -10,3 +10,11 @@ function validatePassword(){
|
|||
}
|
||||
password.onchange = validatePassword;
|
||||
confirm_password.onkeyup = validatePassword;
|
||||
|
||||
function validateEmail(email)
|
||||
{
|
||||
if(email.validity.patternMismatch)
|
||||
email.setCustomValidity('Please input correct email');
|
||||
else
|
||||
email.setCustomValidity('');
|
||||
}
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue