title: Get checkbox values in jQuery?
body: <p>i'am working on checkboxes when user click checkbox i am checking is it checked or not if checked i update value on database here is my code</p>
  
  <pre><code>$(document).ready(function(){
      $('input[type="checkbox"]').bind('click',function() 
      {
           var tObj = $(this).val();
           if ($('#checkpermission').is(':checked'))
           {
              alert(tObj);
              $.ajax({
                    url: 'checkpermission.php',
                    data: {"Selected":tObj},
                    type: 'post',
                    success:function(data)
                    {
                       alert(data);
                       //Succes!
                    }
              });
           }
           else
           {
               // alert(tObj);
               $.ajax({
                     url: 'uncheckpermission.php',
                     data: {"Selected":tObj},
                     type: 'post',
                     success:function(data)
                     {
                        alert(data);
                        //Succes!
                     }
               });
           }
      });
  
  });
  
  
     &lt;?php
  session_start();
  require 'dbconnect.php';
  $page_name="RegisterUsers.php";
  $start=$_GET['start'];
  if(strlen($start) &gt; 0 and !is_numeric($start))
  {
  echo "Data Error";
  exit;
  }
  $eu = ($start - 0);
  $limit = 8;
  $this1 = $eu + $limit;
  $back = $eu - $limit;
  $next = $eu + $limit;
  
  
  
  $query="select * from tbl_user where username!='admin' and password!='admin'";
  $result=mysql_query($query);
  $nume=mysql_num_rows($result);
  if($nume&gt;0)
  {
  
  
  if($_REQUEST['SearchText'])
  {
  
  $find=$_REQUEST['SearchText'];
  $query="select * from tbl_user where username!='admin' and password!='admin' and username LIKE'%$find%' or Email LIKE'%$find%' or PhoneNumber LIKE'%$find%' order by id limit  $eu, $limit";
  }
  else
  {
  $query="select * from tbl_user where username!='admin' and password!='admin' order by username limit  $eu, $limit";
  }
  $result=mysql_query($query);
  while($data=mysql_fetch_row($result))
  {
   if($data[5])
   {
   $path=$redirect."/services/User/".$data[5];
   }
   else
   {
   $path=$redirect."/images/noimage.png";
   }
  ?&gt;
   &lt;tr&gt;
  &lt;td class="gallery"&gt;
  
  &lt;a href='&lt;?=$path ?&gt;'&gt;
   &lt;img width="50" height="50" src=&lt;?php echo $path; ?&gt; /&gt;
   &lt;/a&gt;
  
  &lt;/td&gt;
  &lt;!--&lt;td id='myText'&gt;&lt;img width=50 height=50 src=&lt;?php echo $path; ?&gt; /&gt;&lt;/a&gt;&lt;/td&gt;--&gt;
   &lt;td&gt;&lt;?=$data[1]?&gt;&lt;/td&gt; 
   &lt;td&gt;&lt;?=$data[3]?&gt;&lt;/td&gt;
   &lt;td&gt;&lt;?=$data[4]?&gt;&lt;/td&gt;
   &lt;td&gt;
   &lt;div style="padding-left:25px;"&gt;
   &lt;INPUT TYPE="checkbox" class="checkpermission" name="checkuser" id="checkpermission" value='&lt;?=$data[0]?&gt;'&lt;?php if($data[6]=="Read-Write"){echo "checked";}?&gt;&gt;
   &lt;/div&gt;
   &lt;div&gt;
   Read-Write
   &lt;/div&gt;
   &lt;/td&gt;
  
  &lt;td class='delete'&gt;&lt;a  href='http://ifliptips.com/admin/VueGuides/AddUser.php?id=&lt;?=$data[0]?&gt;&amp;action=edit' &gt;Edit&lt;/a&gt;&lt;/td&gt;
   &lt;td class='delete'&gt;&lt;a href='http://ifliptips.com/admin/VueGuides/RegisterUsers.php?id=&lt;?=$data[0]?&gt;&amp;action=delete' onClick="return deletepressed();"&gt;Delete&lt;/a&gt;&lt;/td&gt;
   &lt;/tr&gt;
  &lt;?php
  }
  }
  ?&gt;
  </code></pre>
  
  <p>every time when user click goes on if condition only else loop not working i am seeing response  </p>
  
  <p>so can any one guide me how can i overcome this
  Thanks for advance.</p>