Dynamic User State & City selection

I need to implement a state-city selection for my users to choose from. Where they first choose their state and then there is a city drop down field that shows only the cities in that state.

Currently, users have to type in the state and city for their account. This concerns me because they may not enter the correct names. I would like this in order to keep these values consistent and to make the site more user friendly.

I thought about creating all the states and cities as categories. I tried this which totaled to over 10,300 categories and sort of crashed my site. Certain pages that needed to access the categories would take update 10 minutes to load the page due to the large number of categories it had to process.

I am looking a solution to this. I would like them to choose their state from a dropdown list and then based on the state chosen they can pick a city of that state from a dropdown list.

I need some major help with this. Thanks a lot.

Topic location-search custom-field menus Wordpress

Category Web


This isn't a WordPress question, its more suitable for StackOverflow.

Regardless, your looking for a chained menu. I've seen this tutorial around a lot, hope it helps.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.