How to Show or Hide Fields Based on User’s Answer

  • NeverEverBlue
    Gevraagd op 13 juli 2023 om 04:38

    Hallo support,

    Ik heb een vraag over de indeling van een van onze jotform pagina. Wij gebruiken een pagina als inschrijfformulier voor een zakelijke reis. Op deze pagina kan de invuller de gegevens van maximaal vier personen invullen die mee op reis gaan. Echter zijn deelnemer 2, deelnemer 3 en deelnemer 4 optioneel. Daarom wil ik deze graag in een uitklapbare spoiler zetten, zodat het formulier minder lang is. Is dat mogelijk? In de bijgevoegde afbeelding is te zien wat voor elementen dan in die spoiler moeten. Let hierbij wel op dat het doorlinkt naar een inschrijf formulier, deze is rechts ook te zien op de foto.


    Ik ben benieuwd.

    Jotform Thread 5324119 Screenshot
  • Chris_L Jotform Support
    Geantwoord op 13 juli 2023 om 09:36

    Hi Kanters,

    Thanks for reaching out to Jotform Support. Unfortunately, our Dutch Support agents are busy helping other Jotform users at the moment. I'll try to help you in English using Google Translate, but you can reply in whichever language you feel comfortable using. Or, if you'd rather have support in Dutch, let us know and we can have them do that. But, keep in mind that you'd have to wait until they're available again.

    Now, let me help you with your question. You create a conditional logic to only show the optional fields based on the user's answer. Let me walk you through it, step by step: 

    1. In Form Builder, click the Add Form Element menu.
      How to Show or Hide Fields Based on User’s Answer Image 1 Screenshot 70
    2. Under the Basic tab, select the Single Choice element.
      How to Show or Hide Fields Based on User’s Answer Image 2 Screenshot 81
    3. While you're in the Basic tab, scroll down and select the Section Collapse. You can drag and drop the element into your form.
      How to Show or Hide Fields Based on User’s Answer Image 3 Screenshot 92You should add 1 Section Collapse element for each section that you want to hide. It is also a must to add 1 Section Collapse element before the Submit button.
    4. Next, you can hide the Section Collapse element before the Submit button. Select the element and click on the Gear Icon.
    5. In the Section Collapse Properties menu, set the Button Visibility to Hidden.
      How to Show or Hide Fields Based on User’s Answer Image 4 Screenshot 103

    Now let's set up the conditional logic.

    1. In Form Builder, in the blue navigation bar at the top of the page, click on Settings.
    2. Click on Conditions in the menu on the left side of the page.
    3. Click +Add a New Condition
      How to Show or Hide Fields Based on User’s Answer Image 5 Screenshot 114
    4. Select Show/Hide Field and then set the conditions just like you see below:
      How to Show or Hide Fields Based on User’s Answer Image 6 Screenshot 125
    5. Click on Save and you're done.

    I understand that your form fields are mapped to eh PDF. If those hidden fields are not filled out, these fields will also show as blank in your PDF. Unfortunately, there is no option to show/hide fields in the PDF.

    Give it a try and let us know if you need any help.