What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

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.


  • Profile Image

    I need to capture a group of required information for each passenger, but I only want to show required field based on number in group

    Asked by junglejamjohn on October 12, 2011 at 11:35 PM

    For each passenger I need to require NAME, COUNTRY, PASSPORT NUMBER, BIRTH DATE, and OCCUPATION. I need to show required fields for only the number of passengers selected. 

    Exmple:

    How many in your group: 3

    (SHOW)

    PASSENGER 1

    FULL NAME AS ON PASSPORT:        COUNTRY:           PASSPORT NUMBER:            BIRTH DATE:            OCCUPATION:

    PASSENGER 2

    FULL NAME AS ON PASSPORT:        COUNTRY:           PASSPORT NUMBER:            BIRTH DATE:            OCCUPATION:

    PASSENGER 3

    FULL NAME AS ON PASSPORT:        COUNTRY:           PASSPORT NUMBER:            BIRTH DATE:            OCCUPATION:

     

    But if "How many in your group:" equals another number, that many groups of data questions will be shown. For more than ten in a group, I may just give a text box and ask the form filler to write in the rest of the passenger information, depending on how complicated adding more sets of questions is.

    What is the most efficient way to accomplish this task? My first thought is to create another form with the 5 questions, and then embed it 10 times with a different header for each one (passenger 1, passenger 2, passenger 3, etc), or creat and embed 10 different forms. Then if it is possible, I could "SHOW" only the number of embeded forms as the number in the group. If the form filler says there is "more than ten, then ten embeded forms would "show" plus a text box would show asking them to fill in the data for passenger 11 and on. Something like that. But I don't know if that will work, and there might be a cleaner, simpler, more poetic solution?

    Any ideas?

    Page URL:
    http://www.jotform.com/form/12781136943

  • Profile Image
    JotForm Support

    Answered by idarktech on October 13, 2011 at 04:04 AM

    Hi John,

    It is still possible using the condition options like the way you did in your form, but I'm afraid it's a huge work to do. We couldn't give you much quick and easier solution as that is the only way to meet the functionality you are looking for. You can check my sample demo which already composed 3 conditions.

    https://www.jotform.com/form/12914841594

     

    If you need clarifications just let us know, we would be happy to help you.

     

    Thanks,

    idarktech

  • Profile Image

    Answered by junglejamjohn on October 19, 2011 at 12:38 AM

    So, I will have to write conditions like

    if HOW MANY = 3

    show PASSENGER #1 NAME

    and show PASSENGER #2 NAME

    and show PASSENGER #3 NAME

    Plus

    if HOW MANY = 3

    show #1 COUNTRY

    and show #2 COUNTRY

    and show #3 COUNTRY

    Plus

    etc with passport number, birth date, and occupation

    and then

    if HOW MANY = 4

    show #1 NAME

    and show #2 NAME

    etc.

    So if for each passenger I have a header plus 5 required feilds = 6 fields to show for each passenger, and if I allow up to 10 passengers, then I will have to make 330 conditions!! There has got to be a better way, no? Anyone have a better way to set up the form?

  • Profile Image

    Answered by paoloumali on October 19, 2011 at 02:17 AM

    Hi,

    At the moment, each submission creates one row of record. There is no way to make the number of fields dynamically corresponding to a particular field's value.

    Since your goal is to create an array of arrays per submission, maybe you can look at using a 'Matrix' (On the left sidebar under Survey Tools)

    Doing so will require you to identify a particular max number of entries, say you get less than 10 passengers per group, how about adding passenger index in the rows?

    Screenshot of Matrix

     

  • Profile Image

    Answered by kasper_v8 on April 13, 2012 at 02:58 AM

    Hi,

    any new modification regarding this "problem"...or paoloumali's ideea is the best for now...?

    great stuff anyway

    Thanks,

    kasper

     

  • Profile Image
    JotForm Support

    Answered by idarktech on April 13, 2012 at 03:14 AM

    @kasper_v8,

    Yes, pauloumali's idea is best for now. We do not have direct solution for this but you can always achieved this using hide/show conditions option. 

    Thanks for asking. Have a great day!

  • Profile Image

    Answered by john on April 14, 2012 at 06:51 PM

    Yes, pauomaliś solution works best for now as far as I can tell, and it is good enough for now, though I hope a better solution evolves eventually.