Skip to main content
Malaga Copy
Participant
February 3, 2016
Question

How do you set multiple check boxes so that at least two of them must be selected?

  • February 3, 2016
  • 1 reply
  • 1689 views

A client has a section on their PDF which has three check boxes, and they need it set so that only one or two of the three options can be selected before finalising the document. The problem they're facing is that when people fill out the form, they tick all three when they're only supposed to select one or two. I know there's a way to link check boxes so that at least one of them is required, but setting two of them has me stumped. I'm guessing something would need to happen where the third remaining check box can't be checked, or some type of warning would appear. Is anything like this even possible?

Any help would be appreciated.

This topic has been closed for replies.

1 reply

AadeshSingh
Participating Frequently
February 3, 2016

Hi malaga‌,

Please check the check box properties & the logic set on the checkboxes.

KB documents for help :-

Regards,
Aadesh

Malaga Copy
Participant
February 4, 2016

Thanks Aadesh. I've almost got it, this is the JavaScript I have applied to each check box:

if (getField("Box1").value=="Yes")
if (getField("Box2").value=="Yes")
if (getField("Box3").value=="Yes")
(getField("Box1").value = getField("Box1").value=="")
(getField("Box2").value = getField("Box2").value=="")
(getField("Box3").value = getField("Box3").value=="")

The only issue I'm facing with this is that selecting all three check boxes does not immediately deselect all of them, it only deselects the last one clicked and one of the other two, leaving a third one selected. Is there a way to tweak this code so that selecting all three check boxes will deselect them all, meaning only two can ever be selected at one time?