Multiple Selection Boxes - Validation Question - InfoPath Dev
in

InfoPath Dev

Multiple Selection Boxes - Validation Question

Last post 05-21-2010 08:19 AM by Catharine. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-14-2010 05:33 AM

    Multiple Selection Boxes - Validation Question

    Hi

    I have the requirement for two multiple selection boxes.

    The options available in second box (Box B) are dependent on the selections in the first box (Box A).  I have this working well. :)

    There are one or two niggles, and I cannot seem to validate them away.

    If the user selects an option from box A and an appropriate item from box B -- and then changes his mind about box A, the value selected in box B may not now be valid - it is still displayed (though moved to the bottom of the list).  How do I (without code 'cos I am using qRules as much as I can), show that this value is invalid ?  

    Also in the first box (box A) - if the user selects more than two options I need to flag up that they should use the "Global" option. I have tried counting the number of entries in a rule of the group but that doesn't seem to work (even accounting for the blank one which multiple selection boxes seems to leave)

    Also... Also if I untick one of the options I want to trigger something to happen.  Is there any way to achieve that ?

    Thank you for your help

    Catharine 

  • 05-17-2010 05:27 AM In reply to

    Re: Multiple Selection Boxes - Validation Question

     It doesn't seem that InfoPath allows placing validation conditions on multi-select listboxes, so what you can do is add expression boxes with conditional formatting to indicate when something isn't right.  You can use similar conditional formatting to disable your submit button or anything you need to do to steer the user in the right direction.

    For the second question, you've probably already discovered that rules on the listbox's field will not fire when an item is unchecked.  So what you can do is this:

    Add two fields named something like selectedCount and previousSelectedCount to your main data source.

    Set the default value of selectedCount to the formula count(listBoxField) and add a rule to the list box's field to set selectedCount to the value of the formula count(listBoxField)

    Add the rules that you want to the selectedCount field, to execute on the condition selectedCount < previousSelectedCount

    As the last rule on the selectedCount field, add a rule (with no condition) to set previousSelectedCount equal to selectedCount

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-19-2010 02:12 AM In reply to

    Re: Multiple Selection Boxes - Validation Question

    Thank you for this information Jimmy.  I am afraid I am very confused by the instructions re selectedCount and previousSelectedCount.

    If I have a default value on selectedCount = count(listboxfield), why do I need a rule which sets selectedCount =count(listboxfield) ?  Surely if I have the Update when value is recalculated ticked that should keep up to date ?

    I have created two fields.  CountRegionalGroups and PreviousCountRegionalGroups.

    Default value for CountRegionalGroups = count(RegionalGroups)  AND  I have a rule on RegionalGroups which (with no condition) sets the value of CountRegionalGroups = count(RegionalGroups).

    When I open the form the value shown is 1.  When I tick one item - the value shown is 1.  When I tick a 2nd item - the value shown is 1.  When I tick a 3rd item  - the value shown is 1.  When I tick a 4th item the value shown is 1.  When I UNtick one of the items - the value shown is 4. 

    This does not sound right ?

    Catharine

  • 05-20-2010 09:42 AM In reply to

    Re: Multiple Selection Boxes - Validation Question

    I REALLY REALLY don't like these multiple selection boxes.  I am tearing my hair out here !

    I can't get my head round what you are trying to achieve with the counting - cos I can't get it to work.

    Is it the case that default values based on multiple selection boxes only get updated when something is de-selected from the box and rules on the multiple selection box only fire when something is added ?

    I am afraid I just don't understand what to do.

  • 05-20-2010 09:53 AM In reply to

    Re: Multiple Selection Boxes - Validation Question

    Hi Catharine,

    Shall we have someone call you?

     

    Patrick Halstead
    Project Manager at Qdabra
  • 05-21-2010 08:19 AM In reply to

    Re: Multiple Selection Boxes - Validation Question

    I finally have the Count and Count previous working!  This tells me when something has been deleted from my check box and I can trigger something to happen when a deletion has occured.

    Now I just have to figure out how to get what needs to happen to happen...

    Catharine

     

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