Validation Test Before Submit - InfoPath Dev
in

InfoPath Dev

Validation Test Before Submit

Last post 01-12-2012 12:23 PM by omnicube. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-12-2012 10:14 AM

    Validation Test Before Submit

    Hi IP Devs,

    I am working in IP 2010 and I have, surprisingly, created a pretty intensive form in IP and I am almost ready for deployment but I have one situation for which I am not sure how to resolve.

    I have eight fields that need to be tested before the user can submit their form to SP.

    I attempted to use validation on my submit control to disable the control if the conditions were not met; however, I am limited to 5 conditions using the rules management options.

    Is there a way to validate all of the fields outside of the rules management tool? For a more detailed explanation, see below:

    I have eight fields that need to be validated - all are drop down boxes (the only values are blank, yes, or no)

    For fields 1 through 6, I need to make sure that they are not all marked no or blank before the user submits their form. Fields 7 and 8 come into play when another field on the form is a certain value. Let's say argument1 is that field. If argument1  = purple then 7 and 8 become relevant. At this point, I would need to make sure that all fields 1 through 8 are not marked with a no or blank.

    Any help is appreciated!

    Thanks

    Cube

  • 01-12-2012 10:23 AM In reply to

    Re: Validation Test Before Submit

    You are not limited to 5 conditions if you change the first dropdown to "The expression" and create your own XPath expression:

    my:field1 = '' and my:field2 = '' and my:field3 = ''

    So:

    my:argument1 != 'purple' and (my:field1 = '' or my:field1 = 'no') and (my:field2 = '' or my:field2 = 'no') and (my:field3 = '' or my:field3 = 'no')

    I've no doubt there is a more elegant XPath for this, but hopefully it gets the general idea across....

    Hilary Stoupa

  • 01-12-2012 12:04 PM In reply to

    Re: Validation Test Before Submit

    Worked like a charm!

     Thanks!

  • 01-12-2012 12:11 PM In reply to

    Re: Validation Test Before Submit

    You bet - Greg Collins taught me that, and it was a huge revelation to me, first off, for the "more than 5 conditions", but now, if I'm uncertain of the XPath for something, I'll pretend like I'm creating a rule condition, then change the first drop down to "The expression" and let InfoPath teach me the right XPath.

    Hilary Stoupa

  • 01-12-2012 12:23 PM In reply to

    Re: Validation Test Before Submit

    The XPath on my form was really long because I have a lot of groups; so, I entered a calculated value control on the form and used the XPath expression builder to build my expression. From here, I changed the view to XPath (advanced) within the builder and subsequently copied and pasted the XPath to the expression box in the rules for my Submit control.

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