Javascript to disable checkbox


I have a list of option for checkbox.
Example: gender = Don’t Know, Male, Female

I want to disable the Male and Female checkbox when I clicked “Don’t know”.

At the JavaScript > onclick, when I tried on radio button, I managed to do it but I cannot apply on checkbox. Please help. Thanks.

document.F1.gender[1].disabled = true;
document.F1.gender[2].disabled = true;
document.F1.gender[1].disabled = false;
document.F1.gender[2].disabled = false;

Since you use 3 checkboxes you can use the SC macro sc_field_disabled in you IF statement.

sc_field_disabled(“Field_Name = True/False”, “Parameter”)