Wednesday, June 13, 2012

Check All or Clear All Checkboxes on your InfoPath Form


There might be some better or easier ways to do this but here's how I got mine to work.

Step 1. Format the check box properties to, value when cleared is equal to 0, and when checked is equal to 1.













Step 2. Create 2 buttons for your "Select All" and "Clear All" operation
            - Add rule on your " Select All" button, by clicking on New > Action













Step 3. On the condition, set the rule as shown on the figure below.

field is equal to "0" or
field is equal to "0" or etc...

Notes: Not sure why, but for some reason you can only set up to 5 conditions in one rule, so you just need to create another rule if you have more than 5 check boxes.












Step 4. Once you're done setting the condition, you can now "Set a field's value" to where your field is going to be equal to 1 as shown on the figure below. Do this to all of the fields you specified on your condition.




















To Clear All, add another rule on your clear all button and do everything in reverse.

Finally, save and preview your InfoPath form before publishing it to your SharePoint form library.

1 comment:

  1. Good Post, I used a checkbox at the top of my column in a table and applied this rather than create buttons.

    ReplyDelete