Can I use conditions to hide a field's options?

  • brayanmuraro74
    Fecha de consulta 18 de octubre de 2024, 18:58

    Hey there, Is there any way I can have a field of unique option selection, with a condition based on let's say "city" for example, that will show only certain options to choose, based on what city the person is from ?

    For example, in my form the person choose the city that the product will be delivered to, but we have different payments method depending on the city, so I want to add conditions that will either show or not show these payment methods depending on what city the customes chose, is this possible? until now, I only found a way to "hide" a complete field, but in this case, I want to hide specific option from this field, I hope you can help me, thanks a lot !

  • Catherine Jotform Support
    Fecha de respuesta 19 de octubre de 2024, 0:26

    Hi Brayan,

    Thanks for reaching out to Jotform Support. I understand you want to hide field options, not the field itself, correct? If so, unfortunately, it's not possible to hide certain field options based on the user's answer on another field. You can use conditional logic to hide fields based on the user's answer, but not field options. All the options you add on a multiple-choice or dropdown field are fixed and cannot be hidden conditionally.

    As a workaround, you could use our Dynamic Dropdown widget, which lets you create a dropdown with nested options or limit the choices that can be selected depending on the form filler’s selection. Let me show you how:

    1. In Form Builder, click on the Add Form Element menu on the left side of the page.

    2. Under the Widgets tab, enter Short Scrollable Terms in the search bar, and drag and drop the widget to your form.

    Can I use conditions to hide a fields options? Image 1 Screenshot 40

    3. Click on the Wand icon on the right side of the widget to open Widget Settings.

    4. Under the General tab, add the values accordingly (based on the widget's instructions).

    I've added an example using three of the cities on your list and assigning random payment methods to each one:

    Can I use conditions to hide a fields options? Image 2 Screenshot 51

    Check out the results below:

    Can I use conditions to hide a fields options? Image 3 Screenshot 62

    For more details, you can check our guide on How to Configure the Dynamic Dropdowns Widget.

    If you want, you can clone my demo form, where you can check the setting closely. We’ve got a guide here that’ll show you how to do that.

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