Embed a Country and Region Dropdown in Webflow
A Webflow form can collect a country with a fixed select, but then someone has to maintain the options and keep the regions in sync. If you control the form markup, a Code Embed can load both lists and refresh the region choices when the country changes.
See the website form guide for the shared snippet and account setup.
What you need
You need access to Webflow's Code Embed element, your own form markup and a destination for submissions. Create a CountriesDB project, copy its public key and allow the hostname where you will publish. Add your Webflow staging hostname too if you plan to use it and your configuration allows it.
Set up the embed
1. Place the fields inside the form
Add the Code Embed where the two selects should appear in your form. If the embed already holds the entire custom form, insert the fields into that form. Keep a single form wrapper so the selects and submit button belong to the same submission.
2. Paste the fields and load the script
Use the field names your destination expects and keep the label IDs unique on the page. Load the widget once with your public key.
<script src="https://unpkg.com/@countriesdb/widget@latest/dist/index.js?public_key=YOUR_PUBLIC_KEY"></script>
<label for="country">Country</label>
<select id="country" name="country" class="country-selection"
data-name="country" data-label="Select country" data-preselected="" required></select>
<label for="region">State / province / region</label>
<select id="region" name="region" class="subdivision-selection"
data-country="country" data-label="Select region"></select>
3. Publish and verify the submitted fields
Test on an allowed published hostname even if the Designer shows a script placeholder. Switch between two countries and confirm the region list updates. Send a test submission and inspect both codes in the configured destination. If the fields appear on the page but are missing from the submission, check their form placement and names before changing the widget settings.
FAQ
Do I need a developer?
You can add an embed yourself if you own the markup and know where it submits. Get help if you need to connect or change the submission handler.
Can I include states and provinces?
Yes. The region select uses the subdivisions available for the selected country.
Will my form destination receive both values?
It depends on how the form submits and maps its fields. Test the complete flow with the destination you use.
Why does it work on one hostname only?
Your published custom domain and your Webflow staging site use different hostnames. Check the project's allowed domains for the one you are testing.