Show number of fields according to number chosen

  • kimg10
    Asked on January 16, 2015 at 1: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.

  • Carina
    Replied on January 16, 2015 at 2:53 PM

    You can see the workaround displayed in this thread:

    http://www.jotform.com/answers/495819

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

    http://form.jotformpro.com/form/50146443448959?

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

  • kimg10
    Replied on January 16, 2015 at 3:12 PM

    Carina,

    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!

  • Kiran Support Team Lead
    Replied on January 16, 2015 at 4: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.

    Show number of fields according to number chosen Image 1 Screenshot 20

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

    http://form.jotformpro.com/form/50156290417956? 

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

    Thanks!

  • kimg10
    Replied on January 16, 2015 at 5:26 PM

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

  • Kiran Support Team Lead
    Replied on January 16, 2015 at 5: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.

    http://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL 

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

    Thank you for using JotForm!!

  • kimg10
    Replied 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.
  • jonathan
    Replied on January 17, 2015 at 9:49 AM

    Hi,

    Since the next question is different from the original topic on this thread, I had created a new post for it here http://www.jotform.com/answers/497917

    We will attend to it as soon as we can

    Thank you.