title: Deleting Multiple selected items from table
body: <p>In my table I have a column with a check box for each row.  I want to be able to delete all the selected items.  I found the code from this website and modified it for my own stuff.
  <a href="http://nuts-and-bolts-of-cakephp.com/2008/05/05/multiple-checkboxes/" rel="nofollow">Link</a></p>
  
  <p>I followed the website's naming convention for the check boxes and it is as follows:</p>
  
  <pre><code>&lt;td&gt;  &lt;?php echo $this-&gt;Form-&gt;checkbox('LocalClocks.id.['.$LocalClock['LocalClock']['id'].']', array('value' =&gt; $LocalClock['LocalClock']['id'])); ?&gt;&lt;/td&gt;
  </code></pre>
  
  <p>This is the code in my controller for the deleteSelected() function:</p>
  
  <pre><code>    public function deleteSelected()
      {
          foreach($this-&gt;data['LocalClocks'] as $key =&gt; $value)
          {
              if($value != 0)
              {
                  $this-&gt;LocalClock-&gt;del($value);
              }
          }
          $this-&gt;redirect($this-&gt;referer());
      }
  </code></pre>
  
  <p>This is the code for the actual delete button (just in case it is needed):</p>
  
  <pre><code>&lt;?php echo $this-&gt;Form-&gt;postLink('Delete Selected', array('action' =&gt; 'deleteSelected'), array('confirm' =&gt; 'Are you sure?')); ?&gt;
  </code></pre>
  
  <p>There are a couple things I think might be the problem:</p>
  
  <ol>
  <li>The code was written for an older version of cake, I think the website said 1.3, but I don't know what to update/correct in the existing code to make it work.</li>
  <li>The delete button is the same as the one on cakephp's website on the blog tutorial. The only change I made was removing the id of the item to delete, because im not deleting a single item but multiple items.</li>
  </ol>
  
  <p>Any help would be great.</p>