title: checkbox on change ajax call
body: <p>I have one checkbox. I want when I checked the checkbox so I get the 1 and then update a mysql query through that get value. 
      I also want if I unchecked the checkbox so I get a value 0 so then I again update the mysql query. Help me. it should be done with ajax call. code will be in PHP.</p>
  
  <p>HTML code</p>
  
  <pre><code>&lt;input type="checkbox" name="action1" id="action1" title="Action 1" value="1" onclick="return Populat_Industry('set_home_vid.php');"/&gt;
  </code></pre>
  
  <p>ajax call</p>
  
  <pre><code>&lt;script&gt;
  function Populat_Industry(url){
      var value=$(#action1).val();
      $.ajax({
     type: "POST",
     url: url,
     async: true,
     data: "value="+value,
     success: function(msg){
        //alert('Success');
         if(msg !='success'){
          //alert('Fail');
         } 
     }
  });
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>PHP code</p>
  
  <pre><code>if($_POST['action1']=='1'){
  $query= mysql_query("UPDATE homevideos SET is_active = '1
  }
  else{
  mysql_query("UPDATE homevideos SET is_active = '0')
  echo 'success';
  </code></pre>