Repository URL to install this package:
|
Version:
4.1.94.17 ▾
|
function validatestrongpassword()
{
//Store the password field objects into variables ...
var pass1 = document.getElementById('newpassword');
//Store the Confimation Message Object ...
var message = document.getElementById('confirmMessage');
//Set the colors we will be using ...
var goodColor = "#66cc66";
var badColor = "#ff6666";
//Compare the values in the password field
//and the confirmation field
//The passwords match.
//Set the color to the good color and inform
//the user that they have entered the correct password
var strongRegex = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})");
if (strongRegex.test(pass1.value)) {
pass1.style.borderColor = goodColor;
message.style.color = goodColor;
message.innerHTML = "Passwords are strongly typed!"
} else {
pass1.style.borderColor = badColor;
message.style.color = badColor;
message.innerHTML = "Password must have lower,upper,digit,special character and must be 8 or more characters!"
return false;
}
}
function validatepasswords()
{
//Store the password field objects into variables ...
var pass1 = document.getElementById('newpassword');
var pass2 = document.getElementById('confirmpassword');
//Store the Confimation Message Object ...
var message = document.getElementById('confirmMessage');
//Set the colors we will be using ...
var goodColor = "#66cc66";
var badColor = "#ff6666";
//Compare the values in the password field
//and the confirmation field
if(pass1.value === pass2.value){
//The passwords match.
//Set the color to the good color and inform
//the user that they have entered the correct password
pass2.style.borderColor = goodColor;
message.style.color = goodColor;
message.innerHTML = "Passwords Match!"
}else{
//The passwords do not match.
//Set the color to the bad color and
//notify the user.
pass2.style.borderColor = badColor;
message.style.color = badColor;
message.innerHTML = "Passwords Do Not Match!"
return false;
}
}