Limit user from choosing same value in dropdown list boxes.. - InfoPath Dev
in

InfoPath Dev

Limit user from choosing same value in dropdown list boxes..

Last post 01-11-2012 01:46 PM by jacob123. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-09-2012 08:25 PM

    • jacob
    • Not Ranked
    • Joined on 01-10-2012
    • Posts 12

    Limit user from choosing same value in dropdown list boxes..

     Im using Infopath Designer 2010. Here's the requirement.

    There are five dropdown list boxes in infopath form with same two values in each dropdown list box (lets say values are A and B)

    User cant select  the value "B" from these dropdown list boxes more than two times. If user selects B for third time, message box pops out stating " You cant select B more than two times"..

    How can we do this in infopath 2010 using out of the box features???

    Plz help me out...Thanks in advance...

  • 01-09-2012 10:46 PM In reply to

    Re: Limit user from choosing same value in dropdown list boxes..

    If you are only concerned with counting the values of B, you can have a temporary variable keep a count of how many instances of B there are in the dropdown.  When a dropdown is set, simply check whether the value is B and then increment your temp variable.  If the value ever goes above 2, you can show a validation error.
    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 01-10-2012 07:25 AM In reply to

    Re: Limit user from choosing same value in dropdown list boxes..

    Can you tell the steps to achieve that???

    Thanks

  • 01-10-2012 09:34 AM In reply to

    Re: Limit user from choosing same value in dropdown list boxes..

    Create an integer field called "temp" and set the default value to 0.  Then select your first dropdown and create an Action rule that if the dropdown field = B then Set a field's value -> temp = temp + 1.  You'll also want to do the opposite in case they change the value to A.  So create another rule that says if dropdown field <> B then Set a field's value -> temp = temp - 1.  Do this for all of the dropdowns.

    Then you just need to create a validation rule that checks if temp > 2 and display an error.

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 01-10-2012 10:50 AM In reply to

    Re: Limit user from choosing same value in dropdown list boxes..

    Hi Anson,

    Thanks a lot...That helped me out...:)

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

    Re: Limit user from choosing same value in dropdown list boxes..

    What if there is restriction in selection of Value "A" too...Lets say user can select only one A and two Bs....If user selects more than that, some msg box should pops up...How to handle this one???? Thanks in advance...Hope to get your reply...

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