I would like to create a form that will calculate how many of a particular option someone selects

  • Profile Image
    Asked on May 08, 2015 at 01:12 PM

    I would like to create a form to be used for a guest list for an event. I will need a number of rows and on each row will need - a box to enter a name, a dropdown to select a ticket type (day or weekend), a box to enter the number of tickets selected.

    There will need to be the option to add additrional rows.

    I would then need to be able to have a box (or two) at the end which will calculate the total number of day tickets and the total number of weekend tickets requested.

    There is no need for any kind of payment processing.

    Is this possible and if so, how can I build a form to do that?

  • Profile Image
    Answered on May 08, 2015 at 01:47 PM


    There's two approach that you can do, first is that you can use any of our widgets found under the "Multiple Entries" category here: http://widgets.jotform.com/category/multiple_entries. The widgets here will let your users to dynamically add new fields, I personally suggest using the Configurable List widget. Unfortunately, this will not let you use those field values in form calculation or in conditional logic.

    The second method is setting up all the fields manually then using conditional logic to hide each section/row, we can then pass the field values because they are plain form fields, using conditions or using the Form Calculation widget. Here's a sample for that I did: http://form.jotformpro.com/form/51275306969969?. If that somehow works for you, you can clone it and understand how I set it up, I can show you a step by step on how I did mine if you like.

    I hope this helps.

    Thank you.

  • Profile Image
    Answered on May 12, 2015 at 10:14 AM

    Thank you, its nearly right but not quite. I would not want a section for each guest, but one continuous list (could be up to 100 names) with one total for each ticket type at the bottom of the complete list.

    So it would look like:

    Name (textbox)    Ticket type (dropdown)
    Name (textbox)    Ticket type (dropdown)
    Name (textbox)    Ticket type (dropdown)
    Name (textbox)    Ticket type (dropdown) etc, preferably with the user able to add lines as necessary

    Then at the end a calculation of:
    Total no. Weekend Guest 
    Total no. Day Guest


    Is that possible?



  • Profile Image
    Answered on May 12, 2015 at 11:33 AM

    You can check our widgets similar to "Configurable List", which allows you to add multiple entries with different field types. Unfortunately, it is not possible to fetch those values and conditionally count the entries based from the ticket type or any other input field value inside the configurable list widget.

    As a workaround, what I have done in my cloned form above is that we will create a number of guest fields and conditionally hide and show them, then we will fetch the values on those plain form fields to perform calculation and conditions. 

    I hope that helps.

    Thank you.

  • Profile Image
    Answered on May 12, 2015 at 01:06 PM

    Thaks very much, it would be great if you could show me a step by step on your example. I am very new to Jotform and have not used conditional logic before.

  • Profile Image
    Answered on May 12, 2015 at 02:40 PM

    If that is the case, I would suggest that you check the following guides:




    Here's the simple step on how I setup my cloned form.

    1. Setup all the necessary fields that you need, in this case, the critical fields are:

    WG - Weekend Guest

    DD - Day Dressing Room

    WG/DD - Weekend Guest with Day Dressing Room.

    They have a value of "0", when a user selects a ticket type, one of them will have the value of "1" which will be used in the sum of ticket types.

    2. We will then setup our conditional logic, here are my rules and actions.

    In my conditional logic, you'll see that when a specific ticket type is selected we'll add a value of "1" on the text box field.

    3. We will then create a new section for Guest 2, you'll just need to follow the steps we did earlier. What I did is I used the form collapse field to divide them by section.

    4. Now by default, it is hidden, we will only show it when the check box "Add Another one?". You can check the conditional logic that I have already setup this rule and action.


    5. After you have setup enough guest numbers, we will sum all the ticket types, I've added three form calculation fields.

    6. In the form calculation widget, we will add all the necessary fields. In this example, I will add all the "Weekend Guest" ticket type from Guest 1 to Guest 2, of course if you have more than 2 guest you will need to add them also in that calculation.


    You might be confused at first, especially the name fields are the same "WG", "DD" and "WG/DD". But you'll get used to it when you continue to explore or use the form builder, we are always here to help you, but I would recommend that you check the guides I have shared. You can also check our Comprehensive Guide List so that you can have a reference. 

    Do let us know if you need more information on this.

    Thank you.