How can I hide or make visible checkboxes based on a single checkbox selection?
I am creating a form to ask:
Have you had any of the following in the past 12 months? (Check all that apply or check here if None [ ]<--named "None Apply" )
checkbox.1 Problem maintaining balance.
checkbox.2 Mental health problems.
checkbox.3 Shortness of breath
checkbox.4 Chemical Dependency
checkbox.5 Needed emergency care
checkbox.6 Other (Explain: [TextboxOther])
My checkbox JS is as follows:
#1 var oAll = this.getField("checkbox");
#2 var aAll = oAll.getArray();
#3
#4 //if "None Apply" checkbox is not checked[Off] then checkbox.1-6 remain visible. If checked then hide checkbox.[1-6] if unchecked become visible again.
#5 if (event.target.value !== "Off") {
#6 //set the check boxes to hidden if none apply;
#7 for(var i = 0; i < aAll.length; i++){
# 8 this.getField("aAll.").display = display.hidden;
#9 console.println(aAll..value);
#10 }
#11 }
#12 else {
#13 //set the check boxes to visible if the none box not checked;
#14 for(var i = 0; i < aAll.length; i++){
#15 this.getField("aAll.").display = display.visible;
#16 }
# 17}
I am getting a syntax error in line 11 that I cannot see for the life of me. Slowly going bald...
