views:

21

answers:

1

I have created a menu to manage user records for wordpress admin. While listing the record I have used check box to select and unselect the record as in Pages menu.

I have to select whole address or name on checkbox click. But here what happens is that when I click on name it selects whole checkbox including name and address. I do not have an idea how the check box works.

Here is the code

    <?php
      foreach($record as $record_row)
      {
        $name = $record_row->name;
        $address = $record_row->name;
      ?>
       <tr>
         <th class="check-column" scope="row">
          <input  name="names[]" class="one" type="checkbox" value="<?php echo $record_row->ID; ?>">
         </th>
         <th class="check-column" scope="row">
          <input  name="address[]" class="two" type="checkbox" id="address[]" value="<?php echo $record_row->ID; ?>">
         </th>
         <td class="column-icon media-icon" width="30%"><?php echo $record_row->name; ?></td>
         <td class="post-title page-title column-title"><?php echo $record_row->name; ?></td>
       </tr>
       <?php
       }?>

Can anyone help me. Thanks in advance.

A: 

Get rid of the id attribute on the checkbox - it's invalid syntax for starters, and every id in your document must be unique!

TheDeadMedic