Checkbox Validation - Repeating Table - IP2013 - InfoPath Dev
in

InfoPath Dev

Checkbox Validation - Repeating Table - IP2013

Last post 10-03-2016 07:42 AM by LarryTremaine. 15 replies.
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts: Previous Next
  • 06-05-2015 07:56 AM

    • JKnox
    • Not Ranked
    • Joined on 06-05-2015
    • Posts 6

    Checkbox Validation - Repeating Table - IP2013

    Attempting to create a validation for a checkbox in a repeating table and having some issues. Please note my form is browser-enabled. My goal: User to be able to set only one check box in the repeating table; if more than one row is selected, a validation error should occur. In addition if no selection is make a validation error should occur. Attempted several other solutions including but not limited to: -count on submit (Issue: unavailable as validation rule on submit is grayed out) - preceding-sibling and following-sibling count(current()/preceding-sibling::my:group1/my:field1[. = "true"]) > 0 or count(current()/following-sibling::my:group1/my:field1[. = "true"]) > 0 (Issue: Received an Illegal Expression on this as the form is browser enabled) Reviewed other options on InfoPath Dev site as well. Nothing seems to work. Custom code is not an option. Can anyone point me in the right direction?
  • 06-05-2015 08:37 AM In reply to

    Re: Checkbox Validation - Repeating Table - IP2013

    Hello JKnox,

    Attached is an example that uses a secondary data source for some helper fields to evaluate the repeating table. Sometimes having a 2DS to evaluate the data works much better than validation rules. In this example the check box triggers a set of rules on the /FormLogic/Actions/EvaluateCheckBoxError field, and displays an error in the /FormLogic/Values/ErrorMessage field. If the error message is not blank, then the submit is also blocked, and the same logic exists on the submit button.

    Hope that example helps!
    Bre

  • 06-05-2015 11:38 AM In reply to

    • JKnox
    • Not Ranked
    • Joined on 06-05-2015
    • Posts 6

    Re: Checkbox Validation - Repeating Table - IP2013

    Thanks Bre. However I am receiving an error: "The following expression could not be parsed because of a syntax error or because it uses an undefined namespace prefix or unsupported function: count(xdXDocument:get-DOM()/...."
  • 06-05-2015 01:36 PM In reply to

    Re: Checkbox Validation - Repeating Table - IP2013

    Are you getting the error while trying to preview this version, or when implementing in your own form?

  • 06-05-2015 02:04 PM In reply to

    • JKnox
    • Not Ranked
    • Joined on 06-05-2015
    • Posts 6

    Re: Checkbox Validation - Repeating Table - IP2013

    It will not allow me to publish. I tried push through the error and the updated form did not publish to my site.
  • 06-08-2015 03:56 PM In reply to

    Re: Checkbox Validation - Repeating Table - IP2013

    Can you attach a copy of your form? Also - is the repeating table bound to the main data source? The form should publish without errors.

  • 06-09-2015 04:12 AM In reply to

    • JKnox
    • Not Ranked
    • Joined on 06-05-2015
    • Posts 6

    Re: Checkbox Validation - Repeating Table - IP2013

    I am unable to attach a copy of the form (Security reasons). It is a repeating section and yes it is bound to the main data source. Form will not publish.
  • 06-09-2015 08:22 AM In reply to

    Re: Checkbox Validation - Repeating Table - IP2013

    Not a problem we just have to get creative. Does the logic work in preview? Can you also paste the xpath to your check box here and also the formula from your form?

  • 06-09-2015 10:54 AM In reply to

    • JKnox
    • Not Ranked
    • Joined on 06-05-2015
    • Posts 6

    Re: Checkbox Validation - Repeating Table - IP2013

    Logic does not work in preview. Check box xpath: /dfs:myfields/dfs:datafields/my:SharePointListItems_RW/my:field1 What formula are you referencing? The one you suggested in the previous solution above?
  • 06-10-2015 09:42 AM In reply to

    Re: Checkbox Validation - Repeating Table - IP2013

    It looks like the checkbox is in your secondary data source. It will need to be in the main data source for the logic.

  • 06-11-2015 10:18 AM In reply to

    • JKnox
    • Not Ranked
    • Joined on 06-05-2015
    • Posts 6

    Re: Checkbox Validation - Repeating Table - IP2013

    My checkbox is on the Main Datasource ( I double checked).
  • 09-28-2016 07:50 AM In reply to

    Re: Checkbox Validation - Repeating Table - IP2013

    Do you have an example that works in 2010? This looks to be very similar to the problem that I am having. It occurs whether I use a Repeating Table or a Repeating Section. Only two controls in the repeating section: checkbox and textbox. Only rule is that if checkbox is checked then the textbox must be non-blank. 1. Works fine in first element when nothing has been repeated. 2. Add a item so now there are two, each with checkbox and textbox. 3. If both checkboxes unchecked ... fine 4. If both checkboxes checked and both have the non-blank textboxes ... fine 5. Element One is checked and has something in its textbox. Element Two is not checked (so therefore its empty textbox value should be ignored) ... failure. Get 'textbox is missing its value' error message courtesy of my validation rule. It appears that Sharepoint is looking at the checkboxes as a collection of two and validating each element against that collection. It isn't honoring the fact that each repeating section/row owns its own checkbox. It isn't ignoring the other checkboxes when validating each element.
  • 09-28-2016 08:03 AM In reply to

    Re: Checkbox Validation - Repeating Table - IP2013

    Here is a copy of the original sample saved as IP 2010. Hope it helps!
    Hilary Stoupa

  • 09-28-2016 08:42 AM In reply to

    Re: Checkbox Validation - Repeating Table - IP2013

    I was hoping for the Checkbox sample that Bre attached in her 06-05-2015 11:37 AM reply. Your example is just a handful of texboxes. Hoping to see a 2010 version of this: Attached is an example that uses a secondary data source for some helper fields to evaluate the repeating table. Thanks ... much appreciated
  • 09-28-2016 08:45 AM In reply to

    Re: Checkbox Validation - Repeating Table - IP2013

    Sorry! I attached the wrong one. :)
    Hilary Stoupa

Page 1 of 2 (16 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.