Count the number of selections made

  • Profile Image
    Asked on June 13, 2016 at 09:51 AM

    I want to warn users that they have selected more colours / sizes than they asked for in quantity.

    I have a quantity order field and a dropdown selection that I want to check ie if they ask for two items and select three different colors. If this happens I want to warn that this is the case. 

  • Profile Image
    Answered on June 13, 2016 at 11:30 AM

    If you want to match the number of quantity to the number of items selected in your check box, then that should be possible by using conditional logic.

    Here's a sample form I made based from your form: 

    1. First, I'll add a "Text" field. This will serve as the warning message when the quantity and the number of check box items are not equal.

    2. Now we will add the "Form Calculation" widget, this will be used to count the number of check box items selected. You can see I named it "Count selected items in check box".

    3. Here's how the widget is setup.

    count( check box field)

    The count() function simply counts the number of selected items in a check box. You can learn more about the math functions here: 


    4. Now we will compare the "Quantity" field and the "Form Calculation" widget using conditional logic. If they are not the same, then we will SHOW the "Text" field with a warning message.


    Let us know if that works.

  • Profile Image
    Answered on June 13, 2016 at 03:26 PM

    Thanks I was on that line, and I will try it latter.

    As always superb service, you guys never cease to amaze me with the speed that you respond to a question. You must be the world record holders.