我想要循环 id peminjaman_id_barang 很多次。我在我的函数中使用 ajax ......这里是我的函数。我使用 codeigniter 3 和 bonfire 框架
$("#peminjaman_id_barang").change(function(e){
e.preventDefault();
e.stopPropagation();
var nilai = "<?php echo base_url('admin/inventaris/peminjaman/stok')?>";
var peminjaman_id_barang = {peminjaman_id_barang:$("#peminjaman_id_barang").val()};
$.ajax({
type: "POST",
url : nilai,
data: {"ci_csrf_token" : '<?php echo $this->security->get_csrf_hash(); ?>',
"peminjaman_id_barang" : $("#peminjaman_id_barang").val()},
success: function(msg){
$('#peminjaman_id_stok').html(msg);
}
});
var nilai = "<?php echo base_url('admin/inventaris/peminjaman/sewa')?>";
var peminjaman_id_barang = {peminjaman_id_barang:$("#peminjaman_id_barang").val()};
$.ajax({
type: "POST",
url : nilai,
data: {"ci_csrf_token" : '<?php echo $this->security->get_csrf_hash(); ?>',
"peminjaman_id_barang" : $("#peminjaman_id_barang").val()},
success: function(msg){
$('#peminjaman_harga_sewa').html(msg);
}
});
});