Question
Make checkboxes hidden/visible for 22 fields with same parent name
I have a form that have fields: "Normal", "NotPresent", "P", "S".
The are all named as Normal1, Normal2, Normal3, etc until Normal22 and same for the other fields.
Right now I have written the ame code in each of the checkboxes, but when I need to make a change I would have to go to each 22 fields to make the change.
This the code for Normal1:
if(event.target.value ==(0)) {
getField("Normal1").required = false;
getField("NotPresent1").required = false;
getField("P1").required = false;
getField("S1").required = false;
this.getField("NotPresent1").display = display.hidden;
this.getField("P1").display = display.hidden;
this.getField("S1").display = display.hidden;
} else {
getField("Normal1").required = true;
getField("NotPresent1").required = true;
getField("P1").required = true;
getField("S1").required = true;
this.getField("NotPresent1").display = display.visible;
this.getField("P1").display = display.visible;
this.getField("S1").display = display.visible;
}
How do I make it go through Normal22 with the same code?
