|
@@ -15,6 +15,35 @@ $(function() {
|
|
|
window.location = url;
|
|
window.location = url;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ $("input[type=password]").keyup(function(event) {
|
|
|
|
|
+ let formText = $(this).next(".form-text");
|
|
|
|
|
+
|
|
|
|
|
+ let lengthSpan = $(formText).find("span[data-length-requirement]");
|
|
|
|
|
+ let upperSpan = $(formText).find("span[data-uppercase-requirement]");
|
|
|
|
|
+ let lowerSpan = $(formText).find("span[data-lowercase-requirement]");
|
|
|
|
|
+ let numberSpan = $(formText).find("span[data-number-requirement]");
|
|
|
|
|
+ let specialSpan = $(formText).find("span[data-special-requirement]");
|
|
|
|
|
+
|
|
|
|
|
+ let upper = new RegExp("[A-Z]");
|
|
|
|
|
+ let lower = new RegExp("[a-z]");
|
|
|
|
|
+ let number = new RegExp("[0-9]");
|
|
|
|
|
+ let special = new RegExp("[^A-Za-z0-9]");
|
|
|
|
|
+
|
|
|
|
|
+ let value = $(this).val();
|
|
|
|
|
+
|
|
|
|
|
+ let lengthClass = value.length >= 6 ? "text-success" : "text-danger";
|
|
|
|
|
+ let upperClass = upper.test(value) ? "text-success" : "text-danger";
|
|
|
|
|
+ let lowerClass = lower.test(value) ? "text-success" : "text-danger";
|
|
|
|
|
+ let numberClass = number.test(value) ? "text-success" : "text-danger";
|
|
|
|
|
+ let specialClass = special.test(value) ? "text-success" : "text-danger";
|
|
|
|
|
+
|
|
|
|
|
+ lengthSpan.attr("class", lengthClass);
|
|
|
|
|
+ upperSpan.attr("class", upperClass);
|
|
|
|
|
+ lowerSpan.attr("class", lowerClass);
|
|
|
|
|
+ numberSpan.attr("class", numberClass);
|
|
|
|
|
+ specialSpan.attr("class", specialClass);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
var maps = [];
|
|
var maps = [];
|