Advertisement
KodingKid

Basic Javascript Password System

Apr 25th, 2021
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function PasswordValidation(password)
  2. {
  3. var pass = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,20}$/;
  4. if(password.value.match(pass))
  5. {
  6. alert('Correct!')
  7. return true;
  8. else
  9. {
  10. alert('Wrong!')
  11. return false;
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement