Checkbox

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jay87
Forum Commoner
Posts: 61
Joined: Thu Jan 07, 2010 5:22 am

Checkbox

Post 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:
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Checkbox

Post 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... :)
Post Reply