title: Jquery select multiple checkboxes
body: <p>I have a list of categories paired with checkboxes. I can't find any documentation on how to store all the selected checkboxes in a var and send the data to the server. I need to delete from the database the selected categories. This is part of the code I'm working on.</p>
  
  <pre><code>var cat_id = $('check_box').attr("id"); //gets the id of the checked category
  var dataString = 'cat_id=' + cat_id; //should send all the selected checkbox IDs
  $('.delete').click(function() 
  {
      $.ajax({
          type: "POST",
          url: "edit_categories.php",
          data: dataString,
          cache: false,
          success: function(html)
          {
              window.location.reload(true);
          }
      });//end ajax
  });//end click function
  </code></pre>
  
  <p>The checkboxes are created dynamically using:</p>
  
  <pre><code>&lt;input type="checkbox" name="check_box" class="check_box" 
      id="&lt;?php echo $cat_id; ?&gt;" /&gt; 
  </code></pre>
  
  <p>Each checkbox will have a unique id and how many they are varies.</p>
  
  <p>In the edit_categories.php I just have an mysql for deleting the categories where cat_id = $_POST['cat_id'] but I can't figure out how to get all the IDs from the selected checkboxes.</p>