Who knows what is the best way to create Country & State picker for user accounts

Hi there,

My client wants to be able to have customer accounts on the website - this is easy, but client needs for the users to be able to choose country and state. Currently we are only interested in having The US and The UK.

I played with the multiple choice field in customer accounts, but it’s not exactly the most elegant.
Ideally I would like to be able to use logic
Step 1 - user selects country
Step 2 - depending on choice customer is presented with states / counties that are relevant to that country.

Did anyone had this issue and / or knows some good ways to accomplish this?

TYVM in advance.

Eugene

Hey Eugene,

If you want them to change dynamically you’ll need custom code and a source of data.
There are probably two approaches here.

USE SELECTS
Setup and position your selects where you want.
Populate the country select, leave city empty.
Write some JS so that when the country is selected, the city is emptied and populated with the relevant cities.
Store those cities in a hidden collection list and parse them out with JS, or store it as raw JSON in your script.

[MAYBE] FINSWEET LIB
This might also be possible to do using FS CMS Filter and FS CMS Select.
However chances are it won’t be simpler and it will still likely require custom code to get them to interact correctly ( since the select needs to repopulate after the filter changes ).