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:
parent
167758957d
commit
a96fea3f43
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue