勾选一个复选框所有复选框都选择在cakephp中删除

时间:2014-04-11 07:54:25

标签: cakephp checkbox

我们需要一个顶部的复选框,如果我们选中它,则所有复选框都被选中。     在检查它是给一个数组发布数据。    在cakephpform帮助器中是否有任何默认功能,或者我应该在这里使用javascript。

<div>

      echo $this->Form->create(null, array(
     'url' => array('controller' => 'manageUsers', 'action' => 'deleteUser')
       ));

        ?>

 <table width="100%" border="1">
   <tr>
        <th></th>
        <th>Name</th>
         <th>Email</th>
         <th>Phone  Number</th>
            </tr>
        <?php foreach($ActiveUsers as $ActiveUser){

            ?> 


        <tr>

         <td><input type="checkbox" name ="status[]" value="<?php echo                  
            $ActiveUser['User']['id'];  ?>"></input></td>

         <td align='center'><?php echo $this->html->link($ActiveUser['User']['name'], 
          array('action' => 'editUser',$ActiveUser['User']['id']), array('escape' => 
            false));?> </td>
        <td align='center'><?php echo $ActiveUser['User']['email']; ?></td>
        <td align='center'><?php echo $ActiveUser['User']['phone']; ?></td>

        </tr>
        <?php }?>
        </table>
         <?php echo $this->Form->end(__('Delete User')); ?>

             </div>

0 个答案:

没有答案