mirror of
https://github.com/zitadel/zitadel.git
synced 2025-04-21 22:31:32 +00:00

* profile data * fix scripts * fix image paths * feat: show profile (with image) when possible * fix profile image width
28 lines
826 B
JavaScript
28 lines
826 B
JavaScript
function disableSubmit(checks, button) {
|
|
let form = document.getElementsByTagName('form')[0];
|
|
let inputs = form.getElementsByTagName('input');
|
|
for (i = 0; i < inputs.length; i++) {
|
|
inputs[i].addEventListener('input', function () {
|
|
if (checks != undefined) {
|
|
if (checks() === false) {
|
|
button.disabled = true;
|
|
return
|
|
}
|
|
}
|
|
if (checkRequired(form, inputs) === false) {
|
|
button.disabled = true;
|
|
return
|
|
}
|
|
button.disabled = false;
|
|
});
|
|
}
|
|
}
|
|
|
|
function checkRequired(form, inputs) {
|
|
for (i = 0; i < inputs.length; i++) {
|
|
if (inputs[i].required && inputs[i].value == '') {
|
|
return false
|
|
}
|
|
}
|
|
return true;
|
|
} |