Hello @Malcolm28876973cmri
Thanks for the detailed follow-up and screenshot. Your checkbox naming and the expanded HDRL/LDL/RAD arrays look fine. The issue appears to be where the JavaScript is being triggered.
Please don't use Mouse Enter for this. Mouse Enter runs when the pointer enters the dropdown field, not when a new dropdown value has actually been selected.
Instead, try the following:
- Open the dropdown Properties > Options and keep Commit selected value immediately checked.
- Go to Properties > Validate.
- Select Run custom validation script > Edit and place the script there.
- Use the dropdown's selected value in the script:
var groups = {
"HDRL": ["cb1","cb2","cb3","cb4","cb5","cb6","cb7","cb8","cb9","cb10","cb11","cb12","cb13"],
"LDL": ["cb14","cb15","cb16","cb17","cb18","cb19"],
"RAD": ["cb20","cb21","cb22"]
};
var allBoxes = [
"cb1","cb2","cb3","cb4","cb5","cb6","cb7","cb8","cb9","cb10","cb11",
"cb12","cb13","cb14","cb15","cb16","cb17","cb18","cb19","cb20","cb21","cb22"
];
// Clear all checkboxes
for (var i = 0; i < allBoxes.length; i++) {
this.getField(allBoxes[i]).value = "Off";
}
// Check boxes for the selected lab group
var selected = event.value;
if (groups[selected]) {
for (var j = 0; j < groups[selected].length; j++) {
this.getField(groups[selected][j]).checkThisBox(0, true);
}
}
Also verify that the dropdown values are exactly HDRL, LDL, and RAD, including capitalization and without extra spaces. With Commit selected value immediately enabled, the validation script should run when the selection is committed. Community guidance for Acrobat combo boxes confirms this behavior. Suggested discussion:
With this setup, choosing HDRL, LDL, or RAD should clear the previous group and select only the corresponding checkboxes. Selecting the blank entry should leave all checkboxes cleared.
Let us know how it goes.
Regards,
Anand Sri.