Hi, @snacks Thanks for reaching out! And thank you for including those details. Hey, @BarryGrennan@Indra have you managed a customization like what @snacks is describing? Thank you very much for taking a look! — Jaycee
(function () {
// Variables
var emailGlobalUnsub = document.querySelector('input[name="globalunsub"]');
// Functions
// Function to disable the other checkbox inputs on the email subscription system page template
function toggleDisabled() {
var emailSubItem = document.querySelectorAll('#email-prefs-form .item');
emailSubItem.forEach(function (item) {
var emailSubItemInput = item.querySelector('input');
if (emailGlobalUnsub.checked) {
item.classList.add('disabled');
emailSubItemInput.setAttribute('disabled', 'disabled');
emailSubItemInput.checked = false;
} else {
item.classList.remove('disabled');
emailSubItemInput.removeAttribute('disabled');
}
});
}
// Execute JavaScript on document ready
domReady(function () {
if (!document.body) {
return;
} else {
// Function dependent on email unsubscribe from all input
if (emailGlobalUnsub) {
emailGlobalUnsub.addEventListener('change', toggleDisabled);
}
}
});
})();