Fixed password validation on form; added lowercase option

Fixed an issue where some criteria on the form page wouldn't change to
red or green when one set one of them to 0 in the config. Also added a
lowercase option.
This commit is contained in:
2020-04-16 14:33:23 +01:00
parent e6eda227fa
commit 4df78a22c5
5 changed files with 23 additions and 12 deletions

View File

@@ -141,16 +141,18 @@
for (var key in data) {
if (data.hasOwnProperty(key)) {
var criterion = document.getElementById(key);
if (data[key] == false) {
valid = false;
if (criterion.classList.contains('list-group-item-success')) {
criterion.classList.remove('list-group-item-success');
criterion.classList.add('list-group-item-danger');
};
} else {
if (criterion.classList.contains('list-group-item-danger')) {
criterion.classList.remove('list-group-item-danger');
criterion.classList.add('list-group-item-success');
if (criterion) {
if (data[key] == false) {
valid = false;
if (criterion.classList.contains('list-group-item-success')) {
criterion.classList.remove('list-group-item-success');
criterion.classList.add('list-group-item-danger');
};
} else {
if (criterion.classList.contains('list-group-item-danger')) {
criterion.classList.remove('list-group-item-danger');
criterion.classList.add('list-group-item-success');
};
};
};
};