I have chain of drop down like Country / state and City. Is there is any way to wait until the drop down population then proceed further? like first load the country and the
You may do like this
$('#cb_country').change(function(){
var id=$(this).val();
$.get('getCity.php',{id:id},function(data){
$("#cb_city").html(data);
});
});
getCity.php:
<?php
require('../conn.php');
$id=$_GET['id'];
$Q=mysql_query("SELECT * FROM city WHERE CountryID='".$id."' ORDER BY Cityname ASC");
do{
echo "<option value='".$row['CityID']."'>".$row['CityName']."</option>";
}
while($row=mysql_fetch_assoc($Q));