0

Good morning. I have a SharePoint list with a custom InfoPath form. One of the fields within that InfoPath form is a Choice field with checkboxes (multi-select). This field is not required, selecting none of the checkboxes is allowed. Selecting multiple checkboxes is also allowed, but selecting just one of the checkboxes is not allowed. How can we display an error or warning to the user completing the form that they must select more than one checkbox (or none at all)? If only one is selected a message should display that the field requires multiple items.

1 Answer 1

0

Try this. My multi-Select box has 4 entries (One, Two, Three, Four). I named it Multi.

Create a text box control named MultiCount in a hidden section. Set the value of this text box to a whole number equal to this function.

count(Multi[. = "One"]) + count(Multi[. = "Two"]) + count(Multi[. = "Three"]) + count(Multi[. = "Four"])

Above, each entry is filtered by the potential value. For the first entry, I simply used Insert Function and chose count, then I inserted my Multi-Select field and chose Filter Data and added the filter Multi is equal to One. This should enable increment and decrement of the counting field.

Now, create a section with your warning message. Write, "You must select at least two entries." Set two Formatting rules on this section.

  1. if MultiCount is equal to 0 Hide this control
  2. if MultiCount is greater than or equal to 2 Hide this control

The warning should appear only when the choice selection is equal to 1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.