I wanted a drop down for country , state and city and doubted the possibility. I scanned the internet for few DBs, I got the country DBs from many websites but there was no single available through top google search allowing me a country state drop down.
I decided to search further and got the following things for Maxmind.com :-
- http://www.maxmind.com/app/country – A free Geo IP country DB
- http://www.maxmind.com/app/city , also I checked my databases and found that I already have the city database.
Now the problem was how to map between country and state. I found the maxmind systems are following some standard codes ,
- for country http://www.maxmind.com/app/iso3166 (it is ISO 3166 Country Codes)
- for state it is following FIPS 10-4 Subcountry codes http://www.maxmind.com/app/fips10_4 , which is a combination of country and region code , example for India the regions are :-
IN,01,”Andaman and Nicobar Islands”
IN,06,”Dadra and Nagar Haveli”
This solved my mapping problem but now I have to convert it to a DB to make it a perfect dropdown. I do not want it to refresh the page with every drop down so I have planned to use jpspan .
This will solve the problem and also I have asked my team to provide the DB for free.
Have a nice Day.