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;

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


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: