Hi guys,
I am thinking to work on two combos for: country and city.
When user selects country in first combo, its cities should be populate in the city combobox.
For it:
1.) Prepare 2 javascript variables: first one with countries id and name, second one with cities id, name and country_id
For Countries:
[
{"id":1, "title":"uk"},
{"id":3, "title":"US"},
{"id":6, "title":"CANADA"},
{"id":8, "title":"AUSTRALIA"}
]
and For Cities:
[
{"id":1, "country_id":1, "city":"LONDON"},
{"id":3, "country_id":1, "city":"Manchester"},
{"id":4, "country_id":2, "city":"New YORK"},
{"id":5, "country_id":2, "city":"New Jersey"},
{"id":8, "country_id":8, "city":"MELBOURN"}
]
Now:
1.) How do i populate the above country data to country combobox?
2.) How do i populate the related cities data to the city combobox when user selects the country?