How to dynamically add sets of fields on the form?

  • NewPerspectivesTravel
    Asked on September 21, 2018 at 8:11 AM

    Hello,

    I am creating a booking form for travel. When I enter the number of travellers in a drop down menu I want to have the correct number of blocks of fields (fame, passport number, date of birth, nationality, etc.) appear according to the number of travellers.

    I have tried doing this with conditions, but it is very, very complicated as each traveller needs to enter in about 10 pieces of information and there seems no way of "grouping" fields so that a number all appear together.

    I have also tried the configurable lists, but you are limited to fields in one row.

    is there a work around for this?

    Thanks,

  • Victoria_K
    Replied on September 21, 2018 at 10:07 AM

    Hello,

    There are 2 options to dynamically create sets of fields, conditionally and using the Configurable List widget. 

    I would suggest to use the Configurable List to allow users multiplying fields. Using custom css codes, the widget's fields can be displayed on several lines, so if you want to try this option again, we will gladly help you to position the fields. 

    Also, you can check the workaround provided at this guide: How-to-Make-the-Configurable-List-Widget-Mobile-Responsive

    Please let us know your form's URL if you need our further assistance.

  • NewPerspectivesTravel
    Replied on September 23, 2018 at 12:05 AM

    Hi Victoria,

    Thanks for the quick reply. The draft form is at: 

    https://eu.jotform.com/build/82632039649362 

    What you suggest works pretty well, although is it possible to put in a label when a row is added (which shows before the fields)?

    Another option I looked at is using tables and conditions, which works pretty well and, in many ways, I think the table look neater than the configurable list option. However, I would like the number of Tables to be shown according to the value selected in the sub-product options from the payment widget, but I do not know how to "pull" the sub-product values (form calculation or Fields in Text pulls the total). Otherwise, I need people to fill in numbers of rooms twice effectively.

    Related to this, I want to be able to pull some of the more detailed information from the Sub-products in the payment widget to have a summary in a Text. However, the only thing which comes out is the total. How can I pull the more detailed information from the payment widget.

    Thanks.

  • Victoria_K
    Replied on September 23, 2018 at 3:55 AM

    Hello,

    Can you please clarify what you mean by "is it possible to put in a label when a row is added"? As I have checked the labels are present on multiplied fields.

    To avoid any confusion, I have moved your second question here: https://www.jotform.com/answers/1588663 

  • NewPerspectivesTravel
    Replied on September 23, 2018 at 4:05 AM

    For example, a heading “Traveller” or “Next Traveller” at the top to name the next group of fields.

  • NewPerspectivesTravel
    Replied on September 23, 2018 at 4:09 AM

    As well as this, tge bigger problem I am facing is trying to pull data (either to form calculation, to fields in Text or to conditions) except the total. I want to be able to use the country names and the quantities, not just the totals.


    thanks for your help.

  • Victoria_K
    Replied on September 23, 2018 at 5:32 AM

    To add a heading for sets of fields in Configurable Leist, you can add the following code into custom CSS area of widget:

    tr:before {

    content: "Traveller";

    zoom: 1.5;

    font-weight: bold;

    }

    Here is suggested output:

    1537695160Booking Form 2018 09 23 12 29  Screenshot 10