Multiple Selection Box - Ensuring at least one value is ticked. - InfoPath Dev
in

InfoPath Dev

Multiple Selection Box - Ensuring at least one value is ticked.

Last post 05-28-2010 10:55 AM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-21-2010 08:32 AM

    Multiple Selection Box - Ensuring at least one value is ticked.

    Hi,

    How do you validate that at least one value in a multiple selection box is ticked.

    My data source is

    Group
    Region (repeating field) 

    My multiple selection box is based on Region 

    I have tried to put the following validation 0 = count(../my:Region[. != ""]) on the Region repeating field. and it doesn't seem to work.

    Catharine

  • 05-24-2010 06:48 AM In reply to

    Re: Multiple Selection Box - Ensuring at least one value is ticked.

    Could you elaborate on what you're using to validate the list box?  I recall you had an earlier post where you mentioned you couldn't find a way to perform validation on a multi-selection list box.

    Are you displaying an error in an expression box, or disabling the submit button, or something else?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-28-2010 09:47 AM In reply to

    Re: Multiple Selection Box - Ensuring at least one value is ticked.

    I put the validation on the underlying field.  And I expected a red * or hatching to appear somewhere on/round the field, or at least the error message to be displayed when I tried to submit the form.

    Am I expecting it to be too clever ?

    Catharine

  • 05-28-2010 10:55 AM In reply to

    Re: Multiple Selection Box - Ensuring at least one value is ticked.

    I see.  This seems to be yet another quirk of the multi-selection list box.  Validation can only be performed on fields that exist.  Since in your case the invalid state is when there are no nodes of your field, validation cannot take place.  I'd suggest using an expression box with a red asterisk that's displayed when none of the items is checked, and use rules to prevent submit when that's the case (if that's your objective).

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.