This is a demonstration of how to create mutually exclusive check boxes using InfoPath 2007.
Below is a screen shot from an InfoPath design form. It contains 3 fields that I want to be mutually exclusive: Yes, No, N/A. I have named these fields fldYes, fldNo and fldNA.
Double click the “Yes” check box and the "Check Box Properties" Dialog Box appears.
Select the rules button and the “Rules” Dialog Box below appears.
Click the “Add” and the “Rule” Dialog Box appears.
Change the name to something user friendly for your purposes. This action is called “When True.”
Select the “Set Condition” button.
The “Condition” Dialog Box appears.
Select the value TRUE and click OK.
That pop up disappears and you are back to the Rule Dialog Box.
Select the “Add Action” button.
The Action Dialog Box pops up.
Select “Set a field’s Value” from the drop down box.
Upon selection, it changes the interface to the Action Dialog.
In my example, I have named my fields fldYes, fldNo and fldNA.
Use the selection box to the right of the Field text box to select “fldNo” as the field to set.
Type in “0” without the quotes into the Value text box. I have found 0 to be much more user-friendly than using FALSE when setting these values. YMMV.
Click OK.
We have set up the rule that whenever the “Yes” box is checked, the “No” box is automatically unchecked (set to FALSE.) We need to do the same steps no for the “N/A” check box. Click “Add Action” and add it for the other check box now, this time selecting the fldNA as the field you want to set the value for.
When you are done, the “Rule” Dialog Box will look like this.
Click “OK” to close the “Rule” Dialog Box.
Now Click “OK” to close the “Rules” Dialog Box.
Now Click “OK” to close the “Check Box Properties” Dialog Box.
Now that we did this for fldYes, we need to do this for fldNo and fldNA, setting the other check boxes to "0" whenever the check box is checked.
It’s a lot of clicking to create these check box behaviors, but it’s a Vanilla solution without relying on writing C# on the back of the form.









No comments:
Post a Comment