What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
How to do dynamic dropdowns e.g. county field based on state field using 2 columns/fields onlyAsked by gorlando 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.
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.
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!
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.
i will work with it but if you have any ideas let me know
I'm currently vying for a spot in Support team and this is what I have as workaround at the moment.
Here is the pastebin link so you can easily copy paste:
Here is the quick view of a demo: http://jotform.paoloumali.com/jotform-dynamic-dropdown.html
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
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.
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!
i think the support team should hire you immediately....
and i will try to incorporate it into my other 3 from that.
adamsmeat, i think i will use eduardos solution
while not exact, it will work for my purposes
both are brilliant.
The sample forms on this thread are listed as Over Quota and can't be viewed.
It should be fixed now. Kindly check. But if not, I've cloned it for you. Here's the new link: