¿Como cambiar un renglon de color usando checbox?
Publicado por Roberto (9 intervenciones) el 25/04/2017 15:42:33
Tengo una consulta que realize hacia la base de datos, lo cual me trae los registros dentro de una table y ahi pongo un checkbox asi se ve la consulta:

Lo que quiero hacer es que cuando selecciono un registro con el check box todo el renglon cambie de color y si lo deselecciono se quite el color
A continucacion dejo el html de como despliego la consulta asi como las propiedades de mi checkbox:

Lo que quiero hacer es que cuando selecciono un registro con el check box todo el renglon cambie de color y si lo deselecciono se quite el color
A continucacion dejo el html de como despliego la consulta asi como las propiedades de mi checkbox:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<form name="frmComanda" method="post" action="procesacomandas.php">
<div class="datagrid">
<table border="1">
<thead><tr>
<th></th>
<th>Folio</th><th>Titulo</th><th>Mesa</th><th>Tiempo 1</th><th>Tiempo 2</th><th>Tiempo 3</th>
<th>Tiempo 4</th><th>Tiempo 5</th><th>Comentarios</th><th>Fecha</th><th>Hora</th></tr>
</thead>
<tbody><tr>
<?php
$re=mysql_query("SELECT
comandas.cveOrden,
comandas.folio,
menus.titulo,
comandas.cveMesa,
menus.tiempo1,
menus.tiempo2,
menus.tiempo3,
menus.tiempo4,
menus.tiempo5,
comandas.comentarios,
comandas.fecha,
comandas.hora
FROM comandas
INNER JOIN menus
ON comandas.cveMenu = menus.cveMenu
WHERE comandas.`status` = 0
ORDER BY cveOrden, fecha, hora")or die(mysql_error());
while($f = mysql_fetch_array($re)){
?>
<td><input type="checkbox" name="chkComandas[]" value="<?php echo $f['cveOrden'] ?>"></td>
<td><?php echo $f['cveOrden']?></td><td><?php echo $f['titulo']?></td><td><?php echo $f['cveMesa']?></td>
<td><?php echo $f['tiempo1']?></td><td><?php echo $f['tiempo2']?></td><td><?php echo $f['tiempo3']?></td>
<td><?php echo $f['tiempo4']?></td><td><?php echo $f['tiempo5']?></td><td><?php echo $f['comentarios']?></td>
<td><?php echo $f['fecha']?></td><td><?php echo $f['hora']?></td></tr>
<?php
}
?>
</tbody>
</table>
</div>
<input type="submit" value="Atender" name="btnAtendido" class="btn"/>
<input type="submit" value="Cancelar" name="btnCancelado" class="btn"/>
Valora esta pregunta


0