Update php/public/forms.js

Signed-off-by: Zoey <zoey@z0ey.de>
This commit is contained in:
Zoey 2023-06-26 12:26:56 +02:00 committed by Simon L
parent 203b7cb3fc
commit 620c72de23

View file

@ -39,12 +39,12 @@
document.getElementById('overlay').classList.remove('loading');
}
function showPassword() {
var Password = document.getElementById("Password");
if (Password.value !== "" && Password.type === "password") {
Password.type = "text";
} else {
Password.type = "password";
function showPassword(id) {
let passwordField = document.getElementById(id);
if (passwordField.value !== "" && passwordField.type !== "text") {
passwordField.type = "text";
} else if (passwordField.value === "" && passwordField.type !== "password") {
passwordField.type = "password";
}
}