How to do dynamic dropdowns e.g. county field based on state field using 2 columns/fields only

  • Profile Image
    Asked on January 30, 2013 at 12:40 PM

    is there any way to do the following?


    i want to have, for example, 3 fields in my jotform.


    U.S. State


    for sale item


    i want to use drop downs for state and county.

    my problem is that i don't want to have 50 jotforms,

    one for each state

    is there a way to programmatically have the user choose

    the state and dynamically populate the county list depending on the state?

    so that the spreadsheet will have only 3 columns?

    as opposed to having hidden state fields in jotform,

    which i assume would populate the spreadsheet

    with 50 columns and would be difficult to manage anyway.

  • Profile Image
    Answered on January 30, 2013 at 02:47 PM

    Hi there, 

    Here is a form that has the State and County part of the problem solved.

    I added drop-down fields and applied conditional logic to show and hide these fields.

    You can clone the form in order to use it if you wish.  You woul simply need to apply the same idea on to the field that will be containing the products.

    I hope this helps!

  • Profile Image
    Answered on January 30, 2013 at 03:02 PM

    that's really nice. thanks.

    but my problem is , as i suspected, that all the columns show

    in the google spreadsheet

    and i want to really only show

    one column for state and one column for county

    in the list view.


    State   County

    Florida  pasco

    Arizona  countyname

    i will work with it but if you have any ideas let me know

  • Profile Image
    Answered on January 30, 2013 at 04:45 PM

    Hi there,

    I'm currently vying for a spot in Support team and this is what I have as workaround at the moment.

    Previous hacks on this use case ends with the user having redundant fields/columns when you use the 'Conditionals' feature of JotForm. So here is my take using extra javascript.


    Here is the pastebin link so you can easily copy paste:


    Here is the quick view of a demo:

    Note that it works only with States AL and CA as I provided options for them only.


    What I'm doing is this:

    1. Along with embedding the jotform script, I'm including jquery and some js code that does the dynamic functionality.

    2. I'm using the Special option for States wherein JotForm allows you to have state Abbreviations

    3. The javascript code will require you to add your JotForm dropdown options for your counties in a certain format as shown below:

    County1, AL

    County2, AL

    County1, CA

    County2, CA


    The state abbreviations are necessary for filtering the counties when state dropdown is changed.

    Since you will have your own form, please look closely at the code portion:



    jotform_id = "#30295750834457", //usually jotform id, needed to reference the iframe

    independent_id = '#input_3', //replace by the id of the master/depended on, state

    dependent_id = '#input_4' //replace by the id of the slave/dependent dropdown select, counties



    Replace them with the values relative to your own form.


    Let me know if you need further help.

  • Profile Image
    Answered on January 30, 2013 at 05:44 PM

    In addition to the excellent suggestion, 

    You may want to try the following approach:

    That form uses an "auto fill" field.  The user can select the State and then start typing the name of the county.  The field should help populate the value accordingly.

    The only down side to this is the accuracy as you do allow the user the option of enter a county from a different state.

    Hope that helps!

  • Profile Image
    Answered on January 30, 2013 at 05:49 PM
    i think the support team should hire you immediately....
    i don't know where to put the javascript, so maybe you can help me with
    this form
    and i will try to incorporate it into my other 3 from that.
  • Profile Image
    Answered on January 30, 2013 at 05:50 PM
    brilliant. thanks
  • Profile Image
    Answered on January 30, 2013 at 05:54 PM
    adamsmeat, i think i will use eduardos solution
    while not exact, it will work for my purposes
    both are brilliant.
  • Profile Image
    Answered on April 09, 2015 at 02:33 PM

    The sample forms on this thread are listed as Over Quota and can't be viewed.

  • Profile Image
    Answered on April 09, 2015 at 05:16 PM


    It should be fixed now. Kindly check. But if not, I've cloned it for you. Here's the new link:


  • Profile Image
    paul field 
    Answered on June 10, 2016 at 12:00 PM

    can this be updated to add City after State and County?


    I have a database of these if you would like me to send it.






    paulmfield AT gmail DOT com