Using AutoAction, I need to disable element for 24h. I have tried various triggers like onBeforeUserProfileEditDisplay and even onAfterUserProfileSaved but no matter what I choose when the user edits profile again, he can change the value of the element before time set expires. Is there a way to keep the setting to disable until 24h have passed?
Code:
$('[name="cb_emailoptions_type"]').on('click', function() {
if ($(this).val() === 'hours') {
alert("You have chosen hours");
if (confirm("Do you really want this ?")) {
$('[value="hours"]').prop('checked', true);
setTimeout(function() {
$('[name="cb_emailoptions_type"]').prop('disabled', false);
}, 86399000);
} else if (confirm != true) {
$('[value="days"]').prop('checked', true);
}
}
});