title: Ajax POST - get a checkbox value for validation
body: <p>I'd like to validate a form with ajax where there is a checkbox field.</p>
  
  <p>I tried in this way but I can't get the value of checkbox field.</p>
  
  <p>MY FORM</p>
  
  <pre><code>&lt;form class="Form" action="?"&gt;
  
     &lt;input type="text" name="type" id="type" /&gt;
     &lt;input type="text" name="action" id="action" /&gt;
     &lt;input type="checkbox" name="chk" id="chk" value="1"&gt;
  
     &lt;input type="submit" value="INSERT" /&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>MY AJAX</p>
  
  <pre><code>  $(".Form").submit(function( event ) {
  
     event.preventDefault();
  
     $.post("control.php", {
  
      type: $("#type").val(),
      action: $("#action").val(),
      chk: $("#chk").val()
      },
  
      function(data){
  
          $("#msg").html(data);
  
      }
  });
  </code></pre>
  
  <p>CONTROL.PHP</p>
  
  <pre><code>// CHECKBOX VALUE
  if($_POST["chk"] == 1){
     echo "THE VALUE IS 1";
  exit;
  }
  </code></pre>
  
  <p>How I could Do this? Thanks</p>
  
  <p>EDIT </p>
  
  <p>I tried pass to control page the chk with no success</p>
  
  <pre><code>$.post("control.php", {
  
     type: $("#type").val(),
     action: $("#action").val(),
     chk: $("#chk").prop('checked')
  },
  </code></pre>
  
  <p>and </p>
  
  <pre><code> $.post("control.php", {
  
     type: $("#type").val(),
     action: $("#action").val(),
     $("#chk").prop('checked')
  },
  </code></pre>
  
  <p>How can I define the name of my checkbox field in ajax post? thanks</p>