How to set conditional logic to show and hide fields depending on the quantity field?

  • Profile Image
    Asked on May 21, 2015 at 07:42 PM

    I setting up a race entry form and was trying to do it so it only needs to be filled out once for each family rather than one per person. I've set up my paypal to allow for selecting# of participants in each category. What I want to do next is have the same number of "name" and "t-shirt size" fields displayed as the quantity selected. So for example if they select 2 adults and 3 kids, then 5 sets of name/t-shirt would then be displayed.

    For the 2nd part of this we offer a family pack, and I'd like them to enter the # of people in their family and have the same number of fields be displayed.

    Is that possible?

    I've attached the in progress link to my form.


  • Profile Image
    Answered on May 21, 2015 at 09:01 PM

    I'm trying to use conditional logic, but it's just not quite right. Here is what I did, but the number of runners isn't updating.






  • Profile Image
    Answered on May 21, 2015 at 11:16 PM


    Rather than adding the categories and quantity to the payment wizard, you can create them manually using plain form fields instead. From there, you can use Conditional logic and/or Form Calculation widget to pass the calculated price to your Payment total field.

    I've cloned your form and made my edits in my end: If you want to clone mine and explore it, you can by following this guide: Here are the steps on how I did mine:

    1. I set up a radio button for the selection of Race Category.


    2. First, explore the conditional logic on how to show and hide fields, I assume you already know this as I see you implemented it in your form.

    3. I'll then use conditional logic to pass a value and the form calculation widget to calculate the prices. Here's an example:

    For the "Individuals", I'll use the Form Calculation widget get the number field for Adult and Child, then calculate depending on the price specific for each. Here's a guide on how to do a form calculation: 

    For the category family, I assume it's a fix $75.00 USD, so what I did is use conditional logic to insert that price to my "Final Total" field.

    Here's the complete list of conditional logic I have.


    4. After that, we want to pass the final total price to the payment wizard, you can follow this guide on how to do that: Here's mine:


    For the list of names and runner, I think it's better to use a dynamic widget that lets you enter multiple entries, you may check a list of it here: The most customizable widget there is the Configurable list widget. Here's a guide for that widget:


    I hope that helps. Do let us know if you need more help on this.

    Thank you.

  • Profile Image
    Answered on May 21, 2015 at 11:21 PM

    I forgot to mention, this version of the form will let you better use the conditional logic to hide and show different fields depending on the quantity field because they are now plain form fields. The quantity field in the payment wizard can be use in conditional logic but has some limits on them. 

    But see which one suits you best. 

  • Profile Image
    Answered on May 22, 2015 at 01:07 AM

    This was fantastic and exactly what I was looking for. Thanks so much!

  • Profile Image
    Answered on May 22, 2015 at 03:45 AM

    On behalf of my colleague, Charlie, you are kindly welcome.

    Please contact us again if you have other questions or need any help, we will be happy to assist you.