How to prefill another dropdown base on the answer from the dropdown

  • paulwalshco
    Asked on September 2, 2024 at 12:24 PM

    Hi,

    I have a dropdown called "Excursion name" and I want it to auto fill the "Operator" drop down in the background so that it gets recorded on submission.

    I have seen in the link below that I can add it manually using conditions but that's going to get very busy very fast.

    https://www.jotform.com/answers/1146390-how-can-i-update-dropdown-values-based-on-another-dropdown-selection

    I have it in a spreadsheet and I'm wondering how I could use it to choose the operator for me based on this?


    How to prefill another dropdown base on the answer from the dropdown Image 1 Screenshot 20

    Many thanks

    Paul

  • Danilo JotForm Support
    Replied on September 2, 2024 at 12:49 PM

    Hi Paul,

    Thanks for reaching out to Jotform Support. Yes, this is possible to prefill the dropdown element based on the selection from another dropdown, you just need to create an Update/Calculation conditional logic. First, you need to have two dropdown elements for Excursion name and Operators. Let me show you how:

    1. In Form Builder, click on the Add Form Element menu on the left side of the page.
    2. Click on the Basic tab, search for the Dropdown Element, and add it to your form.
    3. In the menu on the right side of the page, Under Option, add the name of the Excursion list.

    How to prefill another dropdown base on the answer from the dropdown Image 1 Screenshot 60

    Then, add another Dropdown element with the option of the Operators list:

    1. In Form Builder, click on the Add Form Element menu on the left side of the page.
    2. Click on the Basic tab, search for the Dropdown Element, and add it to your form.
    3. In the menu on the right side of the page, Under Option, add the name of the Operators list.

    How to prefill another dropdown base on the answer from the dropdown Image 2 Screenshot 71After that, you need to create the conditional logic, to prefill the second dropdown once they selected an option. Let me show you how:

    1. In the Form Builder, go to Settings at the top.
    2. Select Conditions on the left.
    3. Add a new Update/Calculate Field condition.

    Steps to create a new Update/Calculate Field condition in Jotform Form Builder Screenshot 82
    Set the condition below:

    How to prefill another dropdown base on the answer from the dropdown Image 3 Screenshot 93

    How to prefill another dropdown base on the answer from the dropdown Image 4 Screenshot 104

    You might want to check my clone form here, feel free to clone it using this guide. Check out the result below:

    How to prefill another dropdown base on the answer from the dropdown Image 5 Screenshot 115 Give it a try and let us know how it goes.

  • paulwalshco
    Replied on September 2, 2024 at 4:46 PM

    Hi Danilo,

    Thanks for your response. Whilst that's more labour-intensive than having a spreadsheet to read the data from, it still works.

    It's a shame there is no way to use a spreadsheet and a look-up.

    This works great though.

    Many thanks

    Paul

Your Answer