Merhaba Bir Kayıt Sayfası Yaptım Ve Ajax ile işlemleri Yapıyorum Fakat bir türlü Checkbox Seçili Olduğunda 1:0 olarak Post Gönderemedim. PHP'de Gönderebiliyorum Ama Ajax'ı Yapamadım
İndex:
<div id="durum"></div>
<input id="kontrol" type="checkbox"><label>Şartları Kabul Et </label>
<button id="gonder"></button>
<script>
$("#gonder").click(function(){
$.ajax({
type: 'POST',
url: 'al.php',
data: { kk: $("#kontrol") },
success:
function(cevap){
$("#durum").html(cevap);
}
});
});
</script>Al:
[PHP]
<?php
if($_POST){
$onay = trim($_POST["kk"] ? 1 : 0);
if ($onay != 1) {
echo "<script>alert('Şartları kabul Etmeniz Gerekiyor'); </script>";
}
?>
[/PHP]