index.php
include ("ayar3.php");
?>
jQuery Select Change Event For Dependent Select Option Field - Demo Preview
<script></script>
<script>
$(function(){
$("ilceler").hide();
$("#iller select").change(function(){
var deger=$(this).val();
var degerler=$("#form1").serialize();
$.ajax({
type:"POST",
url:"ilce_kontrol.php",
data: degerler,
success: function(x){
$("#ilceler").fadeIn('slow');
$("#ilceler select").prepend(x);
}
});
});
});
</script>
ilce_kontrol.php
include ("ayar3.php");
if($_POST){
$id=$_POST["il"];
$bul=mysql_query("SELECT * FROM ilce where il_id='$id'");
while($row=mysql_fetch_array($bul)){
echo '';
}
}else{
return false;
}
?>