Page 1 of 1

Checkbox

Posted: Mon Feb 15, 2010 5:33 am
by Jay87
I have the following code:

Code: Select all

echo "<tr [color=#0000FF]onclick=\"document.location='viewcall.php?id="[/color] . $item['id'] . "&pfx=" . $item['id_prefix']; if($HTTP_SERVER_VARS['QUERY_STRING']){ echo "&";} echo $HTTP_SERVER_VARS['QUERY_STRING'] . "';\"><td class=smooth" . $stripe . "><img src='/images/icons/pri" . $item['priority'] . ".gif'/></td><td align=center class=smooth" . $stripe .">" . $item['id_prefix'] .  $item['id'] . "</td><td class=smooth" . $stripe .">" . substr($item['description'],0,50) . "</td><td class=smooth" . $stripe .">" . $item['logged_fmt'] . "</td><td class=smooth" . $stripe .">" . $days . "d&nbsp;" . $hours . "h&nbsp;" . $mins . "m&nbsp;</td><td class=smooth>" . $item['response'] . "</td><td class=smooth" . $stripe ." style=\"color:DD5555;\">" . $item['engineer'] . "</td><td class=smooth" . $stripe .">" . $item['contact'] . "</td><td class=smooth" . $stripe ." style=\"color:5555AA;\">" . $item['status'] . "</td>[color=#FF0000]<td class=smooth" . $stripe . "><width='25%'><input type=checkbox name=csbox value=yes[/color]  </td></tr>";
 
The checkbox bit is in red but i currently when i click the checkbox it takes me to viewcall.php (bit in blue), i want the checkbox just to select the table row on click, anyone know how i can do this?? (I want to keep the onclick.viewcall.php bit for all the other columns)....

Hope that makes sense :lol:

Re: Checkbox

Posted: Mon Feb 15, 2010 6:33 am
by papa
A bracket is missing:

Code: Select all

"</td><td class=smooth" . $stripe . "><width='25%'><input type=checkbox name=csbox value=yes [b]/>[/b] </td></tr>";
Not that it's gonna change much... :)