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.
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.
- if MultiCount is equal to 0 Hide this control
- 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.