shawnhooper / gravity-forms-country-province-dropdown

Populates Gravity Forms dropdowns with country and province/state names
GNU General Public License v3.0
12 stars 5 forks source link

How to use or implement #1

Open djm56 opened 7 years ago

djm56 commented 7 years ago

Hi This is exactly the idea I am looking for. I will try an add more states for other countries. The site I am using it on wants for about 10 countries. I think I can follow how to add these in the class.

One think how is this implemented in gravity forms do I need two seperate drop downs and what should I call them, I cant really see how to get this to work.

Thanks in advance

shawnhooper commented 7 years ago

Hi,

The way I did this is probably not the most efficient, but it worked for me. I created a country dropdown:

image

and then I created a dropdown for each of our "supported" countries:

image

The trick is the "allow field to be populated dynamically" checkbox, and the name of the input control. In the example above, it's called "states_au", which you'll see referenced in the code that returns the list of Australian states.

djm56 commented 7 years ago

Thanks I will give it a try. I have to add a few more countries I think 3 or 4 more. I will try and push back the changes.

standalone27 commented 6 years ago

This plugin looks great! Anyway a question: is there any way to have the second field populated by the choice of the first, but without having to create each different "second" dropdown? I have a list of 21+ countries and it will be quite uneasy to have all of the dropdowns in the backend...