title: Why isn't iCheck checkbox value being passed using Ajax
body: <p>I am using iCheck checkbox plugin on my site. I am trying to pass the checkbox checked/unchecked value from my html to a php file for database update using Ajax.
  The problem is that the checkbox value isn't being sent over to my php file.</p>
  
  <p>The html code:</p>
  
  <pre><code>&lt;input type="checkbox" name="mail_ssl" id="mail_ssl"&gt;
  </code></pre>
  
  <p>The Ajax code and initiation of the iCheck plugin</p>
  
  <pre><code>$(function(){
  
   $('#mail_ssl').iCheck({
  checkboxClass: 'icheckbox_square-blue'
                  }); 
  
  $('#mail_ssl').on('ifChecked', function () { 
  
  $.ajax({
  type: "POST",
  dataType: "json",
  data: {mail_ssl : 'yes'},
  url: 'mail_settings.php',
  success: function(response) {
      alert(response);
          }
      });
    })  
  
  }); // end function
  </code></pre>
  
  <p>And finally the code in the php file</p>
  
  <pre><code>$updSettings = "";
  $mail_ssl = "";
  $customer_id = 1;
  
  $mail_ssl = $_POST['mail_ssl'];
  $updSettings = $mail_ssl;
  
  $UpdateMailSettings = "update class_customer_settings set smpt_ssl=" . 
  $updSettings . " where customer_id =" .$customer_id;
  mysql_query($UpdateMailSettings, $con);
  
  mysql_close($con);
  </code></pre>
  
  <p>This is re-use of a code I wrote previously which I thought would work fine, but it's not. I am not able to see what's the matter this time around.
  Any help would be great!</p>