Sayfalar tablomda aktif sütunum var int değerinde.
Bir tane de butonum var ios'daki gibi sağa sola giden on/off.
JQuery kodları;
$data["CustomJS"] = "
$('.onoffswitch-checkbox').change(function()
{
var ID = $(this).data('id'),
Durum = 0;
alert(ID);
if($(this).prop('checked') == true)
Durum = 1;
});
";HTML Kodları; <?php
echo '<div class="onoffswitch">
<input type="checkbox" name="onoffswitch['.$Sayfa->Id.']"
class="onoffswitch-checkbox" id="chkAktif_'.$Sayfa->Id.'"
data-id="'.$Sayfa->Id.'"'.(($Sayfa->Aktif == 1)?'checked':'').'>
<label class="onoffswitch-label" for="chkAktif_'.$Sayfa->Id.'">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>';
?>Şu an tıklayınca veritabanındaki ID değerini yakalıyor sadece nasıl yapabilirim ?