tags:

views:

671

answers:

1

I've got several repeating tables sitting in a InfoPath form. Essentially each one lists a load of strings with checkboxes next to them. When the user clicks submit I want to ensure that at least one checkbox per repeating table has been ticked.

I was just in the middle of writing a validating event handler for the table which would set a validation variable to either true or false but I realised that the main data source is read-only on validating and changed events.

How would I go about checking that something has been ticked in the repeating table before the form is submitted?

[NOTE] I'm using repeating tables instead of the multiselection control because the form has to be browser compatible.

Thanks in advance

A: 

I think you have two options (and these are just off the top of my head / not actually building a similar form solution).

1) Build an XPath expression that will evaluate whether or not one of your checkboxes has been selected. Than add a hidden node to your form (one not bound to a control in thew view), and add this validation property to it.

2) Continue writing your event handler, to cancel the submit event after running your custom validation logic in code.

http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.formevents.submit(VS.80).aspx

bryansh