Ben gibi db-tablodan kullanıcı kaydını getiriliyor am
<?php $row=1; ?>
<select id="status<?php echo $row; ?>" name="status<?php echo $row; ?>">
<option value="0">Active</option>
<option value="1">Block</option>
</select>
<?php $row++; ?>
----------------------------------------
Name Status
----------------------------------------
Abc Active
Def Block
Ghi Active
Jkl Block
----------------------------------------
where status is drop-down with two status for each user and If I want to change the status of any user then I select an option from that drop-down and at the same time the status must update in db-table. For this I coded:
for(var r=1; r<=4; r++){
$("status").each(function() {
var sld = $("#status").val();
alert(sld);
$.ajax({
type: "POST",
url: "response.php",
data: "sld="+sld,
success: function(msg){
alert(msg); // this is the response
}
});
});
}
ancak döngü her Açılır için komut dosyası oluşturmak değil ....