Creating a Dropdown Element with List of Countries in World

SignumSol

New Member
Hi Folks,

My customer wants a dropdown with list of countries in the world. Around 242 of them. Is there an easy way to add the 242 country names as Sub options for the element.

Please advice.
 
Don't use a dropdown element.

Create a List for your countries. If you google around, you will find a number of organizations that have freely available MySQL tables for world countries, usually with tbings like ISO codes, etc. You can import one of those into your database, using phpMyAdmin (or whatever client you use), then create a Fabrik List which uses that. You can simply unpublish any elements (fields) you don't need.

Then use a database join element to that list, set to render as a dropdown, on the form that needs the dropdown.

Here's an example of a countries table available on the web:

http://erikastokes.com/mysql-help/country.sql.txt

-- hugh
 
So to create a Fabrik List from that ... save that link i gave as a file. Run it through phpMyAdmin to create the table. In Fabrik, create a new List, and select your new country table. After you save the new List, edit it and make sure country_id is set as the Primary Key.

Then go to your Elements page, and unpublish any of those new elements you don't need. Do not unpublish the country_id.

-- hugh
 
Hi Hugh,
Thank you for the reply. I was able to follow the steps you explained and create a Countries databasejoin element rendered as a dropdown.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top