Select the line checkbox by clicking on the line

Asked

Viewed 198 times

0

How do I select a line and when I click, the checkbox is checked?

inserir a descrição da imagem aqui

 <tbody>
            <?php foreach ($users as $user): ?>
                <!--tr behaviour="app.behaviours.panel"
                data-panel-action="show"
                data-panel-href="<?php // echo $this->Html->url(['action' => 'update', $user['User']['code']]); ?>"
                -->
                <tr>
                    <td>
                        <?php
                            $this->App->setattribute('type', 'checkbox');
                            $this->App->setattribute('toggle', 'User.id');

                            if ($user['User']['id'] == '1' or $user['User']['id'] == '2') {
                                $this->App->setattribute('disabled', 'disabled');
                            }

                            echo $this->App->createinput(false, 'toggle.' . $user['User']['id']);
                        ?>
                    </td>
                    <td><?php echo $user['User']['id']; ?></td>
                    <td><?php echo $user['User']['name']; ?></td>
                    <td><?php echo $user['User']['email']; ?></td>
                    <td><?php echo $user['User']['username']; ?></td>
                </tr>
  • Tried to use the label?

  • It doesn’t have to be. I just want . js to take a class in <tr> and apply javascript to each line

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.