Copy link to clipboard
Copied
Hi there, I have a case assement checklist I am building for evaluating my teams cases. I have a question and the option of Yes, No, and NA. There are 23 questions and each Checkbox is lables Yes1, No1, NA1 ( repeats with a higher number to 23). For each question, if someone selects a check box, I want the other two check boxes to disable. Would this be possible?
So for question 1, if someone selects yes ( checkbox name yes1) I want checkbox No (checkbox name No1 and NA (checkbox name NA1) to disable.
Thank you!!
Copy link to clipboard
Copied
To do that you should rename the fields in each "group" so that they have the same name (such as "Question1") and unique export values (such as "Yes", "No", "N/A"). Then they would act as you've described automatically.
Copy link to clipboard
Copied
So, my export value is set to 1 for each box, because I have it automatically tallying the number of yes and no responses to a total fields.
Copy link to clipboard
Copied
I recommend you change it. A simple script can be used to replace your calculation so that it still works with the new names and export values.
Copy link to clipboard
Copied
Thank you! I have looked at some of the calculation scripts to try and calculate, but was struggling with them.
I am new to building forms and looking at Java courses.
Copy link to clipboard
Copied
It's Javascript, though, not Java...
And if you need help with that code post here again.
Copy link to clipboard
Copied
Thank you, Yes javascript is what I am looking into. I will review the calculation suggestions I found and work through them and will post again if I have any questions. I appreciate the suggestions!
Copy link to clipboard
Copied
Best approach to make checkboxes mutually exclusive is to give them same name and different export value as suggested by try67, but if you don't want to change them now you can use this script in any text field as custom calculation script(field can be hidden):
for(var i=1; i<=23; i++){
var yes = this.getField("Yes"+i);
var no = this.getField("No"+i);
var na = this.getField("NA"+i);
if(yes.value !== "Off"){
no.readonly = true;
na.readonly = true;}
else if(no.value !== "Off"){
yes.readonly = true;
na.readonly = true;}
else if(na.value !== "Off"){
yes.readonly = true;
no.readonly = true;}
else{
yes.readonly = false
no.readonly = false;
na.readonly = false;}}
Copy link to clipboard
Copied
Thank you - If I can't figure out the calculation script to automaticaly tally the total number of checkboxes, Iw ill give this a try!
Copy link to clipboard
Copied
Hi Nesa, This worked perfectly!! I have one more question. I have 5 questions that are in a section, not related to the 23 original checkboxes. This is just Yes and NA options. I tried giving each question's checkbox the same name, but a different export value. However, it is not making the option mutually exclusive. Would the script you provided cause that?
Thank you,