// JavaScript Document		
        $(document).ready(function(){
            $('#district').on('change', function(){
                var districtID = $(this).val();
                if(districtID){
                    $.ajax({
                        type:'POST',
                        url:'ajaxData.php',
                        data:'district_id='+districtID,
                        success:function(html){
                            $('#tehsil').html(html);
                            $('#constituency').html('<option value="">Select Tehsil First</option>');
                            $('#union_concils').html('<option value="">Select Constituency First</option>');
                            $('#school_level').html('<option value="">Select Union Concil First</option>');
                            $('#school_cate').html('<option value="">Select School Level First</option>');
                        }
                    });
                } else {
                    $('#tehsil').html('<option value="">Select District First</option>');
                    $('#constituency').html('<option value="">Select Tehsil First</option>');
                    $('#union_concils').html('<option value="">Select Constituency First</option>');
                    $('#school_level').html('<option value="">Select Union Concil First</option>');
                    $('#school_cate').html('<option value="">Select School Level First</option>');
                }
            });
			
$('#tehsil').on('change', function(){
var tehsilID = $(this).val();
if(tehsilID){
$.ajax({
type:'POST',
url:'ajaxData.php',
data:'tehsil_id='+tehsilID,
success:function(html){
$('#constituency').html(html);
$('#union_concils').html('<option value="">Select Constituency First</option>');
$('#school_level').html('<option value="">Select Union Concil First</option>');
$('#school_cate').html('<option value="">Select School Level First</option>');
}
}); 
}else{
$('#constituency').html('<option value="">Select Tehsil First</option>');
$('#union_concils').html('<option value="">Select Constituency First</option>');
$('#school_level').html('<option value="">Select Union Concil First</option>');
$('#school_cate').html('<option value="">Select School Level First</option>');
}
});

$('#constituency').on('change', function(){
var consID = $(this).val();
if(consID){
$.ajax({
type:'POST',
url:'ajaxData.php',
data:'cons_id='+consID,
success:function(html){
$('#union_concils').html(html);
}
}); 
}else{
$('#union_concils').html('<option value="">Select Constituency First</option>');
$('#school_level').html('<option value="">Select Union Concil First</option>');
$('#school_cate').html('<option value="">Select School Level First</option>');
}
});
	
$('#union_concils').on('change', function(){
var ucID = $(this).val();
if(ucID){
$.ajax({
type:'POST',
url:'ajaxData.php',
data:'uc_id='+ucID,
success:function(html){
$('#school_level').html(html);
}
}); 
}else{
$('#union_concils').html('<option value="">Select Constituency First</option>');
$('#school_level').html('<option value="">Select Union Concil First</option>');
$('#school_cate').html('<option value="">Select School Level First</option>');
}
});
	
$('#school_level').on('change', function(){
var levelID = $(this).val();
if(levelID){
$.ajax({
type:'POST',
url:'ajaxData.php',
data:'level_id='+levelID,
success:function(html){
$('#school_cate').html(html);
}
}); 
}else{
$('#union_concils').html('<option value="">Select Constituency First</option>');
$('#school_level').html('<option value="">Select Union Concil First</option>');
$('#school_cate').html('<option value="">Select School Level First</option>');
}
});
	
});