JimM
02-15-2008, 10:05 PM
Just wanted to check to make sure this practice is ok prior to heading down the road with this code. It validates but is it ok to put an onclick in a TR tag.
<table class="listview" width="700">
<tr><td colspan="4" class="msgblock"><?php echo $var_message; ?></td></tr>
<tr class="listheader">
<th>Last Name</th>
<th>First Name</th>
<th>E-Mail</th>
<th>Phone</th>
</tr>
<?php if ($loop > 0) { for ($i=0; $i<$loop; $i++) { ?>
<tr class="<?php echo ($i % 2) ? 'listRow0' : 'listRow1'; ?>" onclick="window.location='<?php echo $_SERVER['PHP_SELF'] ?>?action=Display&id=<?php echo $data_all[$i]['ID'] ?>'">
<td><?php echo $data_all[$i]['last_name'] ?></td>
<td><?php echo $data_all[$i]['first_name'] ?></td>
<td><?php echo $data_all[$i]['email_add'] ?></td>
<td><?php echo $data_all[$i]['phone'] ?></td>
</tr>
<?php } } ?>
</table>
<table class="listview" width="700">
<tr><td colspan="4" class="msgblock"><?php echo $var_message; ?></td></tr>
<tr class="listheader">
<th>Last Name</th>
<th>First Name</th>
<th>E-Mail</th>
<th>Phone</th>
</tr>
<?php if ($loop > 0) { for ($i=0; $i<$loop; $i++) { ?>
<tr class="<?php echo ($i % 2) ? 'listRow0' : 'listRow1'; ?>" onclick="window.location='<?php echo $_SERVER['PHP_SELF'] ?>?action=Display&id=<?php echo $data_all[$i]['ID'] ?>'">
<td><?php echo $data_all[$i]['last_name'] ?></td>
<td><?php echo $data_all[$i]['first_name'] ?></td>
<td><?php echo $data_all[$i]['email_add'] ?></td>
<td><?php echo $data_all[$i]['phone'] ?></td>
</tr>
<?php } } ?>
</table>