Copy link to clipboard
Copied
I'm having an issue figuring out how to disable a set of checkboxes unless its parent checkbox is checked. I only want the checkboxes in lines B, C, and D to be enabled if checkbox A is checked. If checkbox A is unchecked, anything in lines B, C, and D should reset. I've attached a screenshot below. Thank you for your help!
Copy link to clipboard
Copied
What is the export value of Cab Style#5?
Copy link to clipboard
Copied
Thank you for the quick reply! Listing name first, followed by export value (ex. Name, Export Value):
Checkbox A:
Cab Style; 500 Cab
Checkbox B:
500 Cab Design Options - Acrylic; Clear
500 Cab Design Options - Acrylic; Tinted
Checkbox C:
500 Cab Design Options - Rail Wall; Solid
500 Cab Design Options - Rail Wall; Acrylic
Checkbox D:
500 Cab Design Options - Frame; Silver
500 Cab Design Options - Frame; White
500 Cab Design Options - Frame; Black
Copy link to clipboard
Copied
The export value of Cab Style#5 is:
500 Cab
Copy link to clipboard
Copied
You can use this code as the Mouse Up event of the first check-box:
var subFields = ["500 Cab Design Options - Acrylic", "500 Cab Design Options - Rail Wall", "500 Cab Design Options - Frame"];
if (event.target.valueAsString=="Off") {
for (var i in subFields) this.getField(subFields[i]).readonly = true;
this.resetForm(subFields);
} else {
for (var i in subFields) this.getField(subFields[i]).readonly = false;
}
Edited: Small mistakes fixed in the code