Use conditional logic with dropdown

  • DHH
    Asked on April 4, 2017 at 10:35 AM

    Can I add a dropdown choice question that then changes the next dropdown options ?

     

    I.E.  If I had a dropdown question that was say Breakfast/Lunch/Dinner, can I have the next question automatically change depending on the answer ? So if the customer chooses breakfast the next question would automatically populate with the choices of eggs/bacon/sausage or if they choose lunch the next question changes to have the choices of sandwiches/salads/soups or if they choose dinner the next question would automatically populate the chooses of steak/chicken/ribs etc etc ?

     

    Many thanks,


    Dale Hart

  • Sven
    Replied on April 4, 2017 at 12:23 PM

    This can be done using Conditional Logic, you can create a condition that would show/hide dropdown based on specific dropdown selection. 

    I have created this demo form, you can review/clone it using this URL:

    https://form.jotformpro.com/70933979438978

     

    For more information on how to use conditional logic, refer to this guide:

    Smart Forms Using Conditional Logic

    For more information on how to clone an existing form, refer to this guide:

    How to Clone an Existing Form from a URL

     

    Thank you.

  • DHH
    Replied on April 4, 2017 at 12:44 PM

    Brilliant!! Thank you so much.
    ...
  • DHH
    Replied on April 4, 2017 at 3:44 PM

    Can I ask for a bit more advice please ?
    How can I add a question to allow for multiple versions of the same choices ?
    I.E. If the user wants to order spare parts, I know how to allow them to complete a form of questions for that one part but can I have a question to ask for how many parts they require and then that number of additional choices will appear ?
    So for one part it's...
    Part number
    Size
    Colour
    And for when they choose three from a dropdown I'd need this to appear...
    Part number
    Size
    Colour
    Part number
    Size
    Colour
    Part number
    Size
    Colour
    Many thanks,
    Dale
    ...
  • David JotForm Support Manager
    Replied on April 4, 2017 at 7:21 PM

    What is the form you are working on? You could use the configurable list widget, in which the user can add as many items as he wants to: https://www.jotform.com/help/252-How-to-Add-a-Widget-to-your-Form 

    Let us know if you need more help.

  • DHH
    Replied on April 5, 2017 at 7:44 AM
    My form is this one https://form.jotformeu.com/70924166537360
    Where I have Product type I’d like the customer to be able to choose how may parts they require and then that number of the two drop downs appear. Is that possible ?
    I’ve looked at the configurable widgets and can’t see anything obvious.
    Many thanks,
    Dale
    ...
  • candy
    Replied on April 5, 2017 at 10:11 AM

    Hello Dale,

    I've cloned your form on my side in order to test it.

    As my colleague David has already suggested, Configurable List widget seems to be helpful to your purpose as you can see the screenshot below:

    Use conditional logic with dropdown  Image 1 Screenshot 20

    Please check this following form: https://form.jotform.com/70943745223962

    Please tell us if I misunderstand your purpose and if this is not you've meant, please give us further detailed information related to your problem.

    Thanks in advance.

  • DHH
    Replied on April 5, 2017 at 12:45 PM
    Thanks for trying that. It's nearly right.
    If you notice from my form, when you choose something from the first drop down, it changes the choices in the second. Can that be added to yours ?
    Many thanks,
    Dale
    ...
  • David JotForm Support Manager
    Replied on April 5, 2017 at 2:20 PM

    That would not be possible with the Configurable List widget. You could have a Configurable List widget per each option, and show it based on users answers: https://www.jotform.com/help/316-How-to-Show-or-Hide-Fields-Base-on-User-s-Answer 

    Use conditional logic with dropdown  Image 1 Screenshot 30

    Example: https://form.jotformpro.com/70946013888970 

    Use conditional logic with dropdown  Image 2 Screenshot 41

    Let us know if you need more help.

  • DHH
    Replied on April 6, 2017 at 6:44 AM
    That’s perfect !! Many thanks !!
    ...
  • DHH
    Replied on April 8, 2017 at 5:44 AM
    Hi again,
    My form is this one https://eu.jotform.com/build/70924166537360
    I’ve had to alter this idea a little now as the list of parts will run into the hundreds. So I’ve had to use the ‘Auto Complete’ widget and its called ‘Name of Part’ on my form.
    My issue now though is two fold…
    1. How can I allow the customer to order different quantities of a part from that field. e.g. using a number scroller ?
    2. How can the customer order more than one part ? e.g. a plus (+) button to give another ’Name of Part' ?
    Your help is really appreciated.
    Kind regards,
    Dale
    ...
  • Welvin Support Team Lead
    Replied on April 8, 2017 at 10:06 AM

    Unfortunately, you cannot have a number selector in the Auto Complete widget. A workaround would be to add a dropdown field as your quantity selector.

    You also cannot dynamically duplicate the auto complete widget. You have to add a predefined number of this widget and show it based on conditional logic. 

    The widget should work for you if you want to allow adding an unlimited number of dropdown options. I would suggest keeping it that way.