Disabling elements of a checkbox group

I have a checkbox group that I’m trying to target through HTML Snippets in WordPress. When a session (denoted by one of the checkbox elements) within the group is full, the checkbox needs to be greyed out. I’ve tried all manner of combinations along the lines of the following:

<script type='text/javascript'>
document.getElementById("Mondays")[0].disabled = true;
document.getElementsById("Mondays")[1].disabled = true;
document.getElementById("Mondays")[2].disabled = true;
</script>

But nothing is working. Can anyone help?

This is driving me nuts, as I did this once and then lost the code!!

Read more here: Disabling elements of a checkbox group

Leave a Reply

Your email address will not be published. Required fields are marked *