Limit all checkboxes between two groups with different limits
- November 6, 2022
- 2 replies
- 2151 views
I am creating a PDF form in Acrobat to be used internally and I am hoping there is some JavaScript (or similar code) that can solve my issue. I have never used JavaScript so I am a complete beginner here.
I have a total of 10 checkboxes. The first 6 are divided from the last 4 into two groups (visually, I haven't coded them or done anything to group them in acrobat), but they all relate to the same question.
I want my clients to be able to select up to 3 of the first 6 checkboxes in what I will call Group 1. They can select less than 3, but no more than 3 checkboxes from Group 1. Selecting any checkboxes in Group 1 means they can not select any checkboxes from the second group of 4, let's call this Group 2.
I want my clients to be able to select up to 2 of the last 4 checkboxes in Group 2. They can select less than 2, but no more than 2 checkboxes in Group 2. Selecting any checkboxes in Group 2 means they cannot select any checkboxes from Group 1. If any checkboxes in Group 1 are already selected, they will all deselect as soon as one checkbox is selected in Group 2, and vice versa.
We have two issues currently. One is that our clients are selecting more than 3 in the first group or more than 2 in the second group. Our other issue is that our clients are selecting options from both groups. My hope is that there is a script that can solve both of these issues.
This post is the most similar solution I could find, but I need many more checkboxes and rules (I assume) for my form: https://community.adobe.com/t5/acrobat-discussions/pdf-form-conditional-checkboxes/m-p/3293678
Thank you in advance to anyone willing to help! I hope I explained this clearly. I've attached an image of how the form looks for context but I have hidden the content for privacy reasons.
