I have a codeigniter webform, I want to input city/state details from the user, such that when user selects State; the city dropdown refreshes to contain names of cities in that State.
I don’t want to write an array of all the US states and cities for the code ignitor form, there must have been a module or any other support for that, in which I select a State and it filters the cities dropdown for it.
What’s the best way to achieve it? I mean do code igniter have builtin library for it? or any support from jquery?
If you don’t want to populate the database or write the array for the US States and cities, why don’t you search for the sql dump for it. Here is a link from where you can download the sql dump.
http://www.farinspace.com/us-cities-and-state-sql-dump/
Then you can use ajax to load cities when the selection in the dropdown menu is changed.