Merhaba arkadaşlar checkbox ile seçtidigim her formdaki inputlardaki degerleri tek bir post işleminde göndermek istiyorum ama su haliyle sadece sonuncunu gönderiyor. ben hepsini uc uca ekleyip tek seferde göndersin istiyorum.
<span class="chChildren">
<label class="label-checkbox">Seç:
<input type="checkbox" value="<?=$i;?>" class="chk-row" />
<span class="custom-checkbox"></span>
</label>
</span>
</div>
<form id="mainForm<?=$i;?>" class="form-horizontal">
<div class="form-group m-top-xns">
<label class="col-lg-2 control-label">Başlık</label>
<div class="col-lg-10">
<input type="text" name="baslik[<?=$i;?>]" class="form-control input-sm" value="<?=$baslikt[$i];?>" />
</div><!-- /.col -->
</div><!-- /form-group -->
<div class="form-group m-top-xns">
<label class="col-lg-2 control-label">Net Fiyat</label>
<div class="col-lg-2">
<input type="text" name="net[<?=$i;?>]" class="form-control input-sm" value="<?=round($nett[$i]);?> TL" />
</div>
</div><!-- /form-group -->
</form>
$('#ajaxform a.ekle').on('click', function(){
var chkArray = [];
$(".chChildren input[type=checkbox]:checked").each(function(i) {
chkArray[i] = $(this).val();
//chkArray.push($(this).val());
var veri = $('#mainForm'+chkArray[i]).serialize();
});
$.post('ekle.php',veri,function(result){
if(result)
{
$('#sonuc'+i).html(result);
}
else
{
alert("Bir hata oluştu, işlem yapılamamış olabilir");
}
});
return false;
});