Validation on a group of controls - InfoPath Dev
in

InfoPath Dev

Validation on a group of controls

Last post 10-23-2005 09:19 PM by DavidCrabbe. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-20-2005 09:27 PM

    Validation on a group of controls

    I'd like to validate that at least one selection within a repeating group has been selected. I've created the following group:

    <xsd:element name="Application">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="my:Selected" minOccurs="0"/>
    <xsd:element ref="my:ApplicationName" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>

    Is there a quick way to test that the Selected field is true for at least one item within the repeating group?

    If not I'll just loop around the group and test Selected for each item in turn. Not a major drama, just looking to see if there is a more intelligent way to do this. :)

    David.
  • 10-21-2005 04:56 AM In reply to

    Re: Validation on a group of controls

    I think if you XPath query was something like XDocument.DOM.selectNodes("...").length > 0. Put whatever XPath query you want where "..." is.
    Jason
    http://www.k2distillery.com/
  • 10-21-2005 06:57 AM In reply to

    Re: Validation on a group of controls

    Hi,

    ..and if you want to target a specific field in the nth instance of your repeating section, use something like:
    XDocument.DOM.selectSingleNode("/my:myFields/my:group1/my:group2[n]/my:field1");

    Regards,

    Franck Dauché
  • 10-23-2005 09:19 PM In reply to

    Re: Validation on a group of controls

    Thanks again to both of you. I will have a play with both ideas and see what happens.

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