Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function validatePassword(){
- var password = document.getElementById("password");
- var confirm_password = document.getElementById("confirm_password");
- password.onchange = validatePassword;
- confirm_password.onkeyup = validatePassword;
- if(password.value != confirm_password.value) {
- alert("pw is wrong");
- confirm_password.setCustomValidity("Passwords Don't Match");
- } else {
- confirm_password.setCustomValidity('');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement