Create country/state/city select boxes

how can i achieve country/state/city selection option associated with a custom post type . I have a user submission form for a custom post type "custom", please suggest if someone has already achieved same or any possibility to create this from scratch,
Example: when user select a country, state select box should be populated with respective states and when user selects state respective cities select box should be populated, from there i will create a custom field to store country/state/city as a location (this custom field can be hidden to be used with google maps or other
Any ideas pleas?