Use the Formidable Locations add-on to import Countries, States/Provinces, U.S. Counties, and U.S. Cities so you don't have to add all the locations manually. After this data is imported, it can then be used in Lookup fields. Lookup fields allow your users to select a Country, for example, and then select from States/Provinces within that selected Country.
Download and install
- This add-on requires Formidable Forms Pro. If you haven't already done so, install and activate Formidable Forms Pro.
- Download the latest version of the Locations plugin.
- In your WordPress admin, go to Plugins → Add New and click the 'Upload Plugin' button at the top of the page.
- Upload the zip file you just downloaded in step one. Once the plugin is installed, click ‘Activate Plugin’ or go to the Plugins page, find Formidable Locations and click ‘Activate’.
- Go to the Formidable → Locations page.
- Select the locations you would like to import.
- Click Import Selection.
- Wait while the selected locations import. Do not leave or refresh the page. This will stop the locations from importing. Depending on your server resources, this could take anywhere from 60 seconds to 45 minutes so be prepared to wait.
How to use imported data
After your locations have imported, you can set up Lookup fields to use the locations.
The imported Locations Lookup form is included as an example. Take a look at this form, and try it out to see how the locations work.
You can also replicate this setup in any other form.
- Go into the form where you would like to use these locations.
- Add a Lookup Field and set it up to get options from the Locations list form - Country field.
- Add another Lookup Field. Set it up to get options from the Locations list form - State field. For the "watch field" option, select the Country field you added.
- If you would like to include counties and/or cities, add a Lookup field for each, and set it to watch the preceding Lookup fields.
- That's it! Try out your form. When you select a Country, you should see the States field show up with the States from the selected Country.