Show number of fields according to number chosen

  • Profile Image
    Asked on January 16, 2015 at 01:49 PM

    Hoping someone can help to see if this is possible in JotForm.  In my JotForm named "TravelInformation Form" I wanted to see if there is a way to ask a question about "How many additional travelers".  Based on the answers to that question the form would show that number of "Traveler" and "Birthday" fields.

    For example, if the person filling out the form chose 3 from a drown to the question "How many additional travelers are you traveling with in your party" the form would then show fields for Traveler_2, Traveler_3, and Traveler_4. as well as Birthdate_2, Birthdate_3, and Birthdate_4.  This way I can make all of those fields required (which I can't do now because I am not sure how many travelers each party will have).

    Not sure if this will also play a part in the answer but I am using the form within a website via the source_code.

  • Profile Image
    Answered on January 16, 2015 at 02:53 PM

    You can see the workaround displayed in this thread:

    The demo form display a different number of fields according to the number chosen:

    You can clone the form.
    Let us know if we can be of more assistance.

  • Profile Image
    Answered on January 16, 2015 at 03:12 PM


    I appreciate your response but not sure (based on what I saw in the other thread you pointed me to) this workaround will work.  The reason this will not work is because the fields are still technically there, just shrunk and not expanded.  So, I would not be able to base the "Required" tag on the fields based o the number chosen in the dropdown.  If I were to make them all required, that would not work either because then if the traveler only had themselves traveling they would not be able to submit the form do to the form looking for all additional traveler fields to be completed.

    If for some reason I misunderstood what you pointed me to, please let me know.  Otherwise I will assume this is just not possible with JotForms.  Thanks!

  • Profile Image
    Answered on January 16, 2015 at 04:45 PM

    I understand that you want to display multiple fields based on the additional travellers option selected. As I check your JotForm, I see that there are 6 additional travellers that can be chosen. We can show the number of fields as required by placing conditions on the number of addl. travellers dropdown. Also, all the fields for this section can be marked as required since the hidden fields are not taken into consideration as required fields. The JotForm cannot be submitted unless the displayed addl. fields are not filled based on the number chosen.

    I've cloned your JotForm to my account and made some changes. Please check this demo JotForm if that works for you. 

    Let us know if you have any other questions. We will be happy to help.


  • Profile Image
    Answered on January 16, 2015 at 05:26 PM

    Thanks!  That seems to work for what I was looking for.  Appreciate your help.

  • Profile Image
    Answered on January 16, 2015 at 05:57 PM

    Glad that the demo worked for you. It's our pleasure to assist you. You may clone this JotForm to your account and make necessary modifications by following the guide below. 

    Please do not hesitate to get back to us if you need any further help. 

    Thank you for using JotForm!!

  • Profile Image
    Answered on January 16, 2015 at 10:19 PM

    Thank You!  

    The only other question about this form I had for now is if there is a way to have the address fields output as separate fields (since I will be pushing to a database using an API) even though they are one field in the form.
  • Profile Image
    Answered on January 17, 2015 at 09:49 AM


    Since the next question is different from the original topic on this thread, I had created a new post for it here

    We will attend to it as soon as we can

    Thank you.