Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. function validatePassword(){
  2. var password = document.getElementById("password");
  3. var confirm_password = document.getElementById("confirm_password");
  4.  
  5. password.onchange = validatePassword;
  6. confirm_password.onkeyup = validatePassword;
  7.  
  8. if(password.value != confirm_password.value) {
  9. alert("pw is wrong");
  10. confirm_password.setCustomValidity("Passwords Don't Match");
  11. } else {
  12. confirm_password.setCustomValidity('');
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement