JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
Show number of fields according to number chosenAsked by kimg10 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.
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!
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.
Thanks! That seems to work for what I was looking for. Appreciate your help.
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!!
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