title: Multiple delete with checkbox in codeigniter
body: <p>Please someone help me..i want to delete multiple items with check box selection in code igniter..</p>
  
  <p>what i did: My view page looks like this</p>
  
  <pre><code>&lt;script type="text/javascript" src="&lt;?php echo base_url(); ?&gt;/js/jquery_1_8_1_min.js"&gt;&lt;/script&gt;
  &lt;script language="javascript"&gt;
  $(function(){
      $("#selectall").click(function () {
          $('.case').attr('checked', this.checked);
      });
      $(".case").click(function(){
          if($(".case").length == $(".case:checked").length) {
              $("#selectall").attr("checked", "checked");
          } else {
              $("#selectall").removeAttr("checked");
          }
      });
  });
  &lt;/script&gt;
  
  &lt;?php
  foreach($query as $row)
  {
      ?&gt;
      &lt;tr&gt;&lt;td&gt;&lt;input name="checkbox[]" class="case" type="checkbox"  value="&lt;?php print $row-&gt;reg_id; ?&gt;"&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;?php 
  }
  ?&gt;
  </code></pre>
  
  <p>My controller code:</p>
  
  <pre><code>function del($reg_id) //delete content
  {
      $this-&gt;load-&gt;helper(array('form','url'));
      $this-&gt;load-&gt;model('registration');
      $query=$this-&gt;registration-&gt;delete($reg_id);
      $data['query']=$this-&gt;registration-&gt;cr_getall();
      $this-&gt;load-&gt;view('vw_register',$data);
  }
  </code></pre>
  
  <p>Here my model:</p>
  
  <pre><code>public function del($reg_id)
  {
      $this-&gt;load-&gt;database();
      $del=$this-&gt;db-&gt;delete('tbl_contctform',array('reg_id'=&gt;$reg_id));
      if($del)
      {
          return $del;
      }
      else
      {
          return false;
      }
  }
  </code></pre>
  
  <p>I know i done some mistakes.but i dont knw how to clear that.</p>
  
  <p>is it possible to use ajax .?Please help me.</p>