Function to disable form elements based on conditions
This commit is contained in:
@@ -8,6 +8,19 @@ if (document.body.classList.contains("hero")) {
|
||||
});
|
||||
}
|
||||
|
||||
// function testFoodRelatedInputs() {
|
||||
// const freitagElement = document.getElementById('abendFreitag');
|
||||
// const freitagChecked = (<HTMLInputElement><any>freitagElement).checked
|
||||
|
||||
// const samstagElement = document.getElementById('abendSamstag');
|
||||
// const samstagChecked = (<HTMLInputElement><any>samstagElement).checked
|
||||
|
||||
// const ernaehrungElement = document.getElementById('ernaehrung');
|
||||
// const allergien = document.getElementById('allergien');
|
||||
// (<HTMLInputElement><any>ernaehrungElement).disabled = !freitagChecked && !samstagChecked;
|
||||
// (<HTMLInputElement><any>allergien).disabled = !freitagChecked && !samstagChecked;
|
||||
// }
|
||||
|
||||
window.onload = function() {
|
||||
// Sidebar toggle
|
||||
var sidebarToggleElement = document.querySelector('[data-action="toggle-sidebar"]');
|
||||
@@ -17,6 +30,16 @@ window.onload = function() {
|
||||
});
|
||||
}
|
||||
|
||||
// const freitagAbendElement = document.getElementById('abendFreitag');
|
||||
// if(freitagAbendElement) {
|
||||
// freitagAbendElement.addEventListener('change', (event) => {testFoodRelatedInputs();});
|
||||
// }
|
||||
|
||||
// const samstagAbendElement = document.getElementById('abendSamstag');
|
||||
// if(samstagAbendElement) {
|
||||
// samstagAbendElement.addEventListener('change', (event) => {testFoodRelatedInputs();});
|
||||
// }
|
||||
|
||||
// Form silent submit
|
||||
var formElement = document.querySelector('form');
|
||||
if(formElement) {
|
||||
|
||||
Reference in New Issue
Block a user