Bug 28308: JS changes

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ac724b8f06)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
Jonathan Druart 2025-10-16 12:41:44 +02:00 committed by Jacob O'Mara
parent 167758957d
commit a96fea3f43
No known key found for this signature in database
1 changed files with 18 additions and 0 deletions

View File

@ -337,3 +337,21 @@
[% END %]
</tbody>
</table>
<script>
document.addEventListener("DOMContentLoaded", function () {
const selectElement = document.querySelector('select[name="2-DAYS"]');
const smsCheckbox = document.getElementById("sms2");
const emailCheckbox = document.getElementById("email2");
const digestCheckbox = document.getElementById("digest2");
function updateCheckboxes() {
const isDisabled = !selectElement.value;
if (smsCheckbox) smsCheckbox.disabled = isDisabled;
if (emailCheckbox) emailCheckbox.disabled = isDisabled;
if (digestCheckbox) digestCheckbox.disabled = isDisabled;
}
updateCheckboxes();
selectElement.addEventListener("change", updateCheckboxes);
});
</script>