var password = document.getElementById("password") , confirm_password = document.getElementById("confirmpassword");
function validatePassword()
{
if(password.value != confirm_password.value)
{
confirm_password.setCustomValidity("Passwords Don't Match");
}
else
{
confirm_password.setCustomValidity('');
}
}
password.onchange = validatePassword;
confirm_password.onkeyup = validatePassword;
function validatePassword()
{
if(password.value != confirm_password.value)
{
confirm_password.setCustomValidity("Passwords Don't Match");
}
else
{
confirm_password.setCustomValidity('');
}
}
password.onchange = validatePassword;
confirm_password.onkeyup = validatePassword;
0 Response to "html5 validation on Password matching "
Post a Comment