Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/12/2012, 08:32
Avatar de jandrogdz
jandrogdz
 
Fecha de Ingreso: julio-2012
Ubicación: public $Guadalajara
Mensajes: 397
Antigüedad: 11 años, 10 meses
Puntos: 12
Pregunta Como mostrar div al seleccionar cualquier check

Buenas foro.

Tengo un pequeño problema con una lista que muestro. cada una de las filas contiene un checkbox para ser asignado a una persona lo que quisiera es que al hacer check en cualkier registro este me muestre un div que contiene una lista de usuarios.

tengo esta funcion que me muestra el div pero solo detecta un checkbox.

Código Javascript:
Ver original
  1. function showContent() {
  2.         element = document.getElementById("content");
  3.         check = document.getElementById("check");
  4.         if (check.checked) {
  5.             element.style.display='block';
  6.         }
  7.         else {
  8.             element.style.display='none';
  9.         }
  10.     }

y en php tengo esto

Código PHP:
Ver original
  1. <div id="content" style="display: none;">
  2.                 <p>Asignacion de usuario</p>
  3.                 <select name="usuarios">
  4.                     <option selected="selected">-- Asignar a: --</option>
  5.                 </select>
  6.             </div><br />
  7.             <table cellpadding="0" cellspacing="0" border="0" class="display" id="tareas">
  8.                 <thead>
  9.                     <tr>
  10.                         <th><input type="checkbox" name="" /></th>
  11.                         <th># Orden</th>
  12.                         <th>Fecha</th>
  13.                         <th>Responsable</th>
  14.                         <th>Producto o servicio</th>
  15.                         <th>Cliente</th>
  16.                         <th>Comentario adicional</th>
  17.                         <th>Status</th>
  18.                         <th>Acciones</th>
  19.                     </tr>
  20.                 </thead>
  21.                 <tfoot>
  22.                     <tr class="tfoot">
  23.                         <th colspan="9"></th>      
  24.                     </tr>
  25.                 </tfoot>
  26.                   <tbody>
  27.                   <?php
  28.                     if($objArte = $arte->mostrarTareas())
  29.                         foreach($objArte as $arte)
  30.                         { ?>
  31.                       <tr>
  32.                             <td><input type="checkbox" name="check" id="check" value="<?php echo $arte->cotizacionID; ?>" onchange="javascript:showContent()"/></td>
  33.                             <td><?php echo $arte->cotizacionID; ?></td>
  34.                             <td><?php echo $arte->fecha; ?></td>
  35.                             <td><?php echo $arte->nombre." ".$arte->ap_pat; ?></td>
  36.                             <td><?php echo $arte->cantidad." ".$arte->producto; ?></td>
  37.                             <td><?php echo $arte->cliente; ?></td>
  38.                             <td><?php echo $arte->comentarioAdicional; ?></td>
  39.                             <td>Sin asignar</td>
  40.                             <td style="margin-left: 50px;">
  41.                                 <a href="accionesArte.php?cotizacionID=<?php echo $arte->cotizacionID; ?>"><img src="../images/comments.png" /></a>
  42.                             </td>
  43.                             </tr>
  44.                         <?php
  45.                         }
  46.                         ?>
  47.                      
  48.                 <tbody>
  49.             </table>

De antemano muchas gracias...
__________________
Lo imposible solo cuesta un poco mas