Many times we need to ask customers where to ship their order. The customer can live anywhere in the world, so hard-coding a street address, state, and country box is not practical. Is there any javascript library out there which will update the States select box to relevant options when a different country is selected?

For example, for the U.S. we have 50 states, but when the user chooses a different country, the States select box should update to different options (e.g. if they choose Germany, it should show the 16 German states instead).

UPDATE: I found this, but it doesn't have country codes (e.g. for United States, the option value should be US).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.