2019-01-14 02:05:45 +00:00
|
|
|
const password = document.getElementById("password");
|
|
|
|
const confirm_password = document.getElementById("confirmPassword");
|
2019-01-14 01:48:06 +00:00
|
|
|
function validatePassword(){
|
|
|
|
if(password.value != confirm_password.value) {
|
|
|
|
confirm_password.setCustomValidity("Passwords Don't Match");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
confirm_password.setCustomValidity('');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
password.onchange = validatePassword;
|
2019-01-27 02:18:59 +00:00
|
|
|
confirm_password.onkeyup = validatePassword;
|
|
|
|
|
|
|
|
function validateEmail(email)
|
|
|
|
{
|
|
|
|
if(email.validity.patternMismatch)
|
|
|
|
email.setCustomValidity('Please input correct email');
|
|
|
|
else
|
|
|
|
email.setCustomValidity('');
|
|
|
|
}
|