How to hide a field based on user's answer?

  • Francoise_Gervais
    Asked on May 8, 2025 at 4:33 PM

    https://form.jotform.com/251257084585261

    I have created this form. There are 2 time slots where people can registered. Since we want to make sure they enter the number of participants we made the field required. But, if you register for example for the first time slot, most likely you will not register for the second time slot. I can't seem to be able to have the zero for the dropdown menu? Any solution?


  • Christian Ice JotForm Support
    Replied on May 8, 2025 at 4:58 PM

    Hi Francoise,

    Thanks for reaching out to Jotform Support. You can create a conditional logic to show or hide the other time slot, but you need to use a Single Choice or Dropdown field to ask if they want a second time slot. Here's how:

    1. In Form Builder, click on Add Element + on the left side of the page.
    2. Under Basic tab, find and add a Dropdown field into your form and set up a Yes or No question.

      How to hide a field based on users answer? Image 1 Screenshot 60
    3. Click on Settings in the orange navigation bar at the top of the page.
    4. Select Conditions on the left side of the screen and click on Show/Hide Field.

      How to hide a field based on users answer? Image 2 Screenshot 71
    5. Set up the conditions like shown below and click on Save.

      Condition #1:

      How to hide a field based on users answer? Image 3 Screenshot 82

      Condition #2:

      How to hide a field based on users answer? Image 4 Screenshot 93

    Here's how it looks:

    How to hide a field based on users answer? Image 5 Screenshot 104

    We also have a guide on How to Hide or Show Multiple Fields Conditionally that you can check out.

    Give it a try and let us know how it goes.

  • Francoise_Gervais
    Replied on May 8, 2025 at 5:20 PM

    But that doesn't really work....noboby will come to 2 time slots. They come to one or the other. so it would make more sense to have the option 0 in the drop down menu. If they come to the walk at 11:00...they need to be able to answer 0 at the one at 8:30 for example.


  • Francoise_Gervais
    Replied on May 8, 2025 at 5:22 PM

    also, I want them to be able to see the 2 times slot.. don't want them to hide them so they can pick

  • Christian Ice JotForm Support
    Replied on May 8, 2025 at 5:48 PM

    Hi Francoise,

    I’ll need a bit of time to look into this. I’ll get back to you as soon as I can.

    Thanks for your patience, we appreciate it.

  • Christian Ice JotForm Support
    Replied on May 8, 2025 at 8:15 PM

    Hi Francoise,

    Thanks for confirming that only one time slot is needed. I understand that you want the fields to be required, while still allowing users to choose between two time slots. The issue you're facing is that, once the fields are set as required, users are unable to submit the form if they only select one time slot, correct? Keep in mind that the availability of each slot is determined by the stock you've configured in the inventory widget. A slot will only become unavailable once all allocated slots have been selected.

    To address this, the best solution would be to apply conditional logic that un-requires the other time slot field if at least one is filled. For example:

    • If the first time slot is filled, un-require the second.
    • If the second time slot is filled, un-require the first.

    This ensures that users can submit the form with just one selected time slot, while still allowing them to choose both if needed. Let me show you how to do it:

    1. In Form Builder, in the orange navigation bar at the top of the screen, click on Settings.
    2. Click on Conditions on the left side of the screen. Now click on the Add Condition Button and select the Enable/ Require/ Mask Field Condition.
    3. Now, copy the settings on the screenshot below:

      How to hide a field based on users answer? Image 1 Screenshot 30
    4. Make sure to Save the condition settings. Note that you need to do the same conditions for the other time slot. 

      How to hide a field based on users answer? Image 2 Screenshot 41

    Give it a try and let us know how it goes.

  • Francoise_Gervais
    Replied on May 8, 2025 at 11:37 PM

    Great thanks!

Your Answer