jQuery Ajax Based Country, State and City List

In this tutorial, you can populate dynamic list of state and city with the help of jQuery and ajax. By default country drop down is displayed.

When you will select country from the list, State drop down will be appeared with the list of states for the current selected country.

When you will select state from the list, City drop down will be appeared with the list of cities for the current selected state.

jQuery Based Country State City List

jQuery Based Country State City List

Demo Code

Step 1 – Create Database

Create new database tgl_db.

Step 2 – Import Tables

Import attached tgl_country.sql into the database tgl_db.

tgl_country.sql

Import attached tgl_state.sql into the database tgl_db.

tgl_state.sql

Import attached tgl_city.sql into the database tgl_db.

tgl_city.sql

Add following files :-

1. db.inc.php
2. index.php
3. ajax_state.php
4. ajax_city.php

db.inc.php

index.php

ajax_state.php

ajax_city.php

Leave a Reply

Your email address will not be published. Required fields are marked *