Dynamically show fields based on the number of days

  • shaidavid
    Asked on March 6, 2018 at 3:59 AM

    I am interested to build a form for trip feedback.

    Therefore, if the trip length was 3 days long, so the form should pop 3 days subforms, as the number of the days.

    Every day should contain a couple of questions (name, location, how long, recommendation, special tips...) per site, and the number of sites also dynamic, so after the first site description (the set of questions above), I will need to add a question like:
    "Have you been on another site during this day?", and accordingly, pop the set of questions for the new site.

    Can you help me build a template for these use cases?

  • Elton Support Team Lead
    Replied on March 6, 2018 at 5:21 AM

    There are 2 ways to achieve that.

    1. Through Show/Hide Condition. You can show a group of fields based on the entered number of days. The downside for this is that you will have to create all the fields needed for the maximum number of days you'd want to allow. Example, if the maximum number of days is 10, and each section consists of 4 fields, that would be a total of 40 fields. Technically, fields are not dynamically created within the page since they are predefined, they are only shown through the condition.

    Guide: https://www.jotform.com/help/297-Show-or-Hide-Multiple-Fields-at-Once-Using-the-Section-Collapse-Field

    2. Using the Configurable List Widget. This does not require a number, the user can add as many fields as they pleased by simply clicking the add button.

    Hope this helps!