How do i add a drop down menu with a list of countries,city?

While’s creating a form on my website i noticed i dont have an option to add a drop down menu full of countries and cities? can anyone please provide me with the steps on how to add this to my form?

Hi Rabin,

Welcome to the Wix Code forums.

The Cascading Form does pretty much what you want. You can use this as a good start.

Good luck,

Yisrael

Okay, But The only states shown in this exmaple are from the US. There’s no data on any other country how do i obtain that?

You’ll have to do an Internet search and see if you can find a suitable database. This is not something that is built-in to Wix Code.

I’ve tried to search for it and couldn’t find anything that helps

Hi Rabin,

Here’s what you can do:

  1. Add all of the countries yourself to code (copy from here )
  2. Integrate with google maps API for this

Liran.

You can find more information on the Place Autocomplete page. When you select the country with your country dropdown, you can then limit Google’s response to only that country using parameters under optional parameters - components .

Happen to Make a JS with all the countries for a project, you can use it and replace the US States with it:

export const countries = [
{ value: “Afghanistan”, label: “Afghanistan” },
{ value: “Albania”, label: “Albania” },
{ value: “Algeria”, label: “Algeria” },
{ value: “Andorra”, label: “Andorra” },
{ value: “Angola”, label: “Angola” },
{ value: “Antigua and Barbuda”, label: “Antigua and Barbuda” },
{ value: “Argentina”, label: “Argentina” },
{ value: “Armenia”, label: “Armenia” },
{ value: “Australia”, label: “Australia” },
{ value: “Austria”, label: “Austria” },
{ value: “Azerbaijan”, label: “Azerbaijan” },
{ value: “Bahamas”, label: “Bahamas” },
{ value: “Bahrain”, label: “Bahrain” },
{ value: “Bangladesh”, label: “Bangladesh” },
{ value: “Barbados”, label: “Barbados” },
{ value: “Belarus”, label: “Belarus” },
{ value: “Belgium”, label: “Belgium” },
{ value: “Belize”, label: “Belize” },
{ value: “Benin”, label: “Benin” },
{ value: “Bhutan”, label: “Bhutan” },
{ value: “Bolivia”, label: “Bolivia” },
{ value: “Bosnia & Herzegovina”, label: “Bosnia & Herzegovina” },
{ value: “Botswana”, label: “Botswana” },
{ value: “Brazil”, label: “Brazil” },
{ value: “Brunei”, label: “Brunei” },
{ value: “Bulgaria”, label: “Bulgaria” },
{ value: “Burkina Faso”, label: “Burkina Faso” },
{ value: “Burundi”, label: “Burundi” },
{ value: “Cabo Verde”, label: “Cabo Verde” },
{ value: “Cambodia”, label: “Cambodia” },
{ value: “Cameroon”, label: “Cameroon” },
{ value: “Canada”, label: “Canada” },
{ value: “Central African Republic”, label: “Central African Republic” },
{ value: “Chad”, label: “Chad” },
{ value: “Chile”, label: “Chile” },
{ value: “China”, label: “China” },
{ value: “Colombia”, label: “Colombia” },
{ value: “Comoros”, label: “Comoros” },
{ value: “Congo”, label: “Congo” },
{ value: “Costa Rica”, label: “Costa Rica” },
{ value: “Croatia”, label: “Croatia” },
{ value: “Cuba”, label: “Cuba” },
{ value: “Cyprus”, label: “Cyprus” },
{ value: “Czech Republic”, label: “Czech Republic” },
{ value: “Côte d’Ivoire”, label: “Côte d’Ivoire” },
{ value: “Denmark”, label: “Denmark” },
{ value: “Djibouti”, label: “Djibouti” },
{ value: “Dominica”, label: “Dominica” },
{ value: “Dominican Republic”, label: “Dominican Republic” },
{ value: “DR Congo”, label: “DR Congo” },
{ value: “Ecuador”, label: “Ecuador” },
{ value: “Egypt”, label: “Egypt” },
{ value: “El Salvador”, label: “El Salvador” },
{ value: “Equatorial Guinea”, label: “Equatorial Guinea” },
{ value: “Eritrea”, label: “Eritrea” },
{ value: “Estonia”, label: “Estonia” },
{ value: “Ethiopia”, label: “Ethiopia” },
{ value: “Fiji”, label: “Fiji” },
{ value: “Finland”, label: “Finland” },
{ value: “France”, label: “France” },
{ value: “Gabon”, label: “Gabon” },
{ value: “Gambia”, label: “Gambia” },
{ value: “Georgia”, label: “Georgia” },
{ value: “Germany”, label: “Germany” },
{ value: “Ghana”, label: “Ghana” },
{ value: “Greece”, label: “Greece” },
{ value: “Grenada”, label: “Grenada” },
{ value: “Guatemala”, label: “Guatemala” },
{ value: “Guinea”, label: “Guinea” },
{ value: “Guinea-Bissau”, label: “Guinea-Bissau” },
{ value: “Guyana”, label: “Guyana” },
{ value: “Haiti”, label: “Haiti” },
{ value: “Holy See”, label: “Holy See” },
{ value: “Honduras”, label: “Honduras” },
{ value: “Hungary”, label: “Hungary” },
{ value: “Iceland”, label: “Iceland” },
{ value: “India”, label: “India” },
{ value: “Indonesia”, label: “Indonesia” },
{ value: “Iran”, label: “Iran” },
{ value: “Iraq”, label: “Iraq” },
{ value: “Ireland”, label: “Ireland” },
{ value: “Israel”, label: “Israel” },
{ value: “Italy”, label: “Italy” },
{ value: “Jamaica”, label: “Jamaica” },
{ value: “Japan”, label: “Japan” },
{ value: “Jordan”, label: “Jordan” },
{ value: “Kazakhstan”, label: “Kazakhstan” },
{ value: “Kenya”, label: “Kenya” },
{ value: “Kiribati”, label: “Kiribati” },
{ value: “Kuwait”, label: “Kuwait” },
{ value: “Kyrgyzstan”, label: “Kyrgyzstan” },
{ value: “Laos”, label: “Laos” },
{ value: “Latvia”, label: “Latvia” },
{ value: “Lebanon”, label: “Lebanon” },
{ value: “Lesotho”, label: “Lesotho” },
{ value: “Liberia”, label: “Liberia” },
{ value: “Libya”, label: “Libya” },
{ value: “Liechtenstein”, label: “Liechtenstein” },
{ value: “Lithuania”, label: “Lithuania” },
{ value: “Luxembourg”, label: “Luxembourg” },
{ value: “Madagascar”, label: “Madagascar” },
{ value: “Malawi”, label: “Malawi” },
{ value: “Malaysia”, label: “Malaysia” },
{ value: “Maldives”, label: “Maldives” },
{ value: “Mali”, label: “Mali” },
{ value: “Malta”, label: “Malta” },
{ value: “Marshall Islands”, label: “Marshall Islands” },
{ value: “Mauritania”, label: “Mauritania” },
{ value: “Mauritius”, label: “Mauritius” },
{ value: “Mexico”, label: “Mexico” },
{ value: “Micronesia”, label: “Micronesia” },
{ value: “Moldova”, label: “Moldova” },
{ value: “Monaco”, label: “Monaco” },
{ value: “Mongolia”, label: “Mongolia” },
{ value: “Montenegro”, label: “Montenegro” },
{ value: “Morocco”, label: “Morocco” },
{ value: “Mozambique”, label: “Mozambique” },
{ value: “Myanmar”, label: “Myanmar” },
{ value: “Namibia”, label: “Namibia” },
{ value: “Nauru”, label: “Nauru” },
{ value: “Nepal”, label: “Nepal” },
{ value: “Netherlands”, label: “Netherlands” },
{ value: “New Zealand”, label: “New Zealand” },
{ value: “Nicaragua”, label: “Nicaragua” },
{ value: “Niger”, label: “Niger” },
{ value: “Nigeria”, label: “Nigeria” },
{ value: “North Korea”, label: “North Korea” },
{ value: “Norway”, label: “Norway” },
{ value: “Oman”, label: “Oman” },
{ value: “Pakistan”, label: “Pakistan” },
{ value: “Palau”, label: “Palau” },
{ value: “Panama”, label: “Panama” },
{ value: “Papua New Guinea”, label: “Papua New Guinea” },
{ value: “Paraguay”, label: “Paraguay” },
{ value: “Peru”, label: “Peru” },
{ value: “Philippines”, label: “Philippines” },
{ value: “Poland”, label: “Poland” },
{ value: “Portugal”, label: “Portugal” },
{ value: “Qatar”, label: “Qatar” },
{ value: “Romania”, label: “Romania” },
{ value: “Russia”, label: “Russia” },
{ value: “Rwanda”, label: “Rwanda” },
{ value: “Saint Kitts & Nevis”, label: “Saint Kitts & Nevis” },
{ value: “Saint Lucia”, label: “Saint Lucia” },
{ value: “Samoa”, label: “Samoa” },
{ value: “San Marino”, label: “San Marino” },
{ value: “Sao Tome & Principe”, label: “Sao Tome & Principe” },
{ value: “Saudi Arabia”, label: “Saudi Arabia” },
{ value: “Senegal”, label: “Senegal” },
{ value: “Serbia”, label: “Serbia” },
{ value: “Seychelles”, label: “Seychelles” },
{ value: “Sierra Leone”, label: “Sierra Leone” },
{ value: “Singapore”, label: “Singapore” },
{ value: “Slovakia”, label: “Slovakia” },
{ value: “Slovenia”, label: “Slovenia” },
{ value: “Solomon Islands”, label: “Solomon Islands” },
{ value: “Somalia”, label: “Somalia” },
{ value: “South Africa”, label: “South Africa” },
{ value: “South Korea”, label: “South Korea” },
{ value: “South Sudan”, label: “South Sudan” },
{ value: “Spain”, label: “Spain” },
{ value: “Sri Lanka”, label: “Sri Lanka” },
{ value: “St. Vincent & Grenadines”, label: “St. Vincent & Grenadines” },
{ value: “State of Palestine”, label: “State of Palestine” },
{ value: “Sudan”, label: “Sudan” },
{ value: “Suriname”, label: “Suriname” },
{ value: “Swaziland”, label: “Swaziland” },
{ value: “Sweden”, label: “Sweden” },
{ value: “Switzerland”, label: “Switzerland” },
{ value: “Syria”, label: “Syria” },
{ value: “Tajikistan”, label: “Tajikistan” },
{ value: “Tanzania”, label: “Tanzania” },
{ value: “TFYR Macedonia”, label: “TFYR Macedonia” },
{ value: “Thailand”, label: “Thailand” },
{ value: “Timor-Leste”, label: “Timor-Leste” },
{ value: “Togo”, label: “Togo” },
{ value: “Tonga”, label: “Tonga” },
{ value: “Trinidad and Tobago”, label: “Trinidad and Tobago” },
{ value: “Tunisia”, label: “Tunisia” },
{ value: “Turkey”, label: “Turkey” },
{ value: “Turkmenistan”, label: “Turkmenistan” },
{ value: “Tuvalu”, label: “Tuvalu” },
{ value: “U.K.”, label: “U.K.” },
{ value: “U.S.”, label: “U.S.” },
{ value: “Uganda”, label: “Uganda” },
{ value: “Ukraine”, label: “Ukraine” },
{ value: “United Arab Emirates”, label: “United Arab Emirates” },
{ value: “Uruguay”, label: “Uruguay” },
{ value: “Uzbekistan”, label: “Uzbekistan” },
{ value: “Vanuatu”, label: “Vanuatu” },
{ value: “Venezuela”, label: “Venezuela” },
{ value: “Viet Nam”, label: “Viet Nam” },
{ value: “Yemen”, label: “Yemen” },
{ value: “Zambia”, label: “Zambia” },
{ value: “Zimbabwe”, label: “Zimbabwe” }
];

Dear Sir,
I’m new with Wix.com and I’m trying to create database using Wix. Now i’m trying to create drop down but still not success. This is the situation,
There are 2 drop down in the page, first I named as Kategori (category) and the second one is Jenis (types). For Kategori i have 6 choices which are KENDERAAN, PERABOT, PERALATAN PEJABAT, KOMPUTER, PERALATAN KOMUNIKASI and INVENTORI. Is it possible for the to set, if the using choose KENDERAAN for the first drop down, then the 2nd drop down will only show KERETA and VAN. If the user choose PERABOT for the first drop down, then the 2nd drop down only will show SOFA, MEJA PEJABAT, ALMARI, KAUNTER. and so on for other choices from the first drop down.

See the Cascading Form example which demonstrates how to do what you want.

Hello again. I’m havig a real hard time finding a code for a drop down country list to put on my WIX form. Is there such a thing called countries.js that I could copy and paste? Is there a walkthrough for a numbskull like me that knows nothing about programming? Please help

Hello thanks so much for that. How can I input this code so that it reflects in my Form when people click on the “Country” button to show this drop down menu and they can choose their country?

As Yisrael has already stated twice in this old forum post, use the cascading form example from Wix that you can open up in your own editor and see it all fully made up with elements all done and code all done too, if you want to add more then you will have to do that hard work for it, nobody is going to do it for you unless you go ask in Wix Arena.
Cascading Form