HEX
Server: Apache/2.4.63 (Unix)
System: Linux pinkman.beget.ru 5.10.258-0-beget-acl #1 SMP Mon Jun 8 11:35:04 UTC 2026 x86_64
User: kulikosl (3031)
PHP: 8.4.6
Disabled: NONE
Upload Files
File: /home/k/kulikosl/kulikosl.beget.tech/public_html/back/zootheme 2612/functions/js/password.js


var myInput = document.getElementById("psw");

if(myInput){

var myConfirm = document.getElementById("confirmpassword");
var letter = document.getElementById("letter");
var capital = document.getElementById("capital");
var number = document.getElementById("number");
var length = document.getElementById("length");

// When the user clicks on the password field, show the message box
myInput.onfocus = function() {
  document.getElementById("message").style.display = "block";
}

// When the user clicks outside of the password field, hide the message box
myInput.onblur = function() {
  document.getElementById("message").style.display = "none";
}

// When the user starts to type something inside the password field
myInput.onkeyup = function() {
  // Validate lowercase letters
  var lowerCaseLetters = /[a-z]/g;
  if(myInput.value.match(lowerCaseLetters)) {
    letter.classList.remove("invalid");
    letter.classList.add("valid");
  } else {
    letter.classList.remove("valid");
    letter.classList.add("invalid");
}

  // Validate capital letters
  var upperCaseLetters = /[A-Z]/g;
  if(myInput.value.match(upperCaseLetters)) {
    capital.classList.remove("invalid");
    capital.classList.add("valid");
  } else {
    capital.classList.remove("valid");
    capital.classList.add("invalid");
  }

  // Validate numbers
  var numbers = /[0-9]/g;
  if(myInput.value.match(numbers)) {
    number.classList.remove("invalid");
    number.classList.add("valid");
  } else {
    number.classList.remove("valid");
    number.classList.add("invalid");
  }

  // Validate length
  if(myInput.value.length >= 8) {
    length.classList.remove("invalid");
    length.classList.add("valid");
  } else {
    length.classList.remove("valid");
    length.classList.add("invalid");
  }
}


myConfirm.onkeyup = function() {
var confirm=myConfirm.value;
if(confirm!=myInput.value){
myConfirm.classList.add("incorrect");
document.getElementById("submit_form").disabled = true;
}
else{
myConfirm.classList.remove("incorrect");
document.getElementById("submit_form").disabled = false;	
}
 	
}


}