Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/03/2012, 21:56
Avatar de jhonnyfernando
jhonnyfernando
 
Fecha de Ingreso: abril-2006
Ubicación: Bogotá - Colombia
Mensajes: 103
Antigüedad: 18 años, 11 meses
Puntos: 1
Respuesta: Script en while

Hola dasuve.

Probablemente el problema es que esta metiendo la función de Javascript dentro del While y la estaba redefiniendola.

Mira esto a ver si sirve, le hice algunos cambios.

Código PHP:
<?php
    $i 
0;
    while(
$resultado mysql_fetch_array($result)){
        
?>
        <div style="position:absolute; left:10px;"><?php echo $resultado['nombre']?></div>
        <div style="position:absolute; left:100px;"><?php echo $resultado['apellidos']?></div>
        <div style="position:absolute; left:300px;"><?php echo $resultado['licencia']?></div>
        <div style="position:absolute; left:400px;"><?php echo $resultado['dorsal']?></div>
        <div style="position:absolute; left:480px;">
            <A href="./secure.php?f=10&id='.$resultado['id'].'"><img src="./css/img/iconos/pencil-16.png" alt="Editar"></a>
        </div>
        <div style="position:absolute; left:500px;">
            <A href=""><img src="./css/img/iconos/cross-16.png" alt="Eliminar"></a>
        </div>
        <div style="position:absolute; left:540px;">
            <input type="checkbox" name="check" value="1" onchange="javascript:showContent('conteniding_<?php echo $i?>', this);" />
        </div>
        <br />
        <div id="conteniding_<?php echo $i?>" style="display:none;">
            <br />
            Lista de pruebas
            <br /><br />
        </div>
        <?php
        $i
++;
    }
?>
<script type="text/javascript" language="javascript">
    function showContent(elemento, check){
        var element = document.getElementById(elemento);
        if(check.checked){
            element.style.display="block";
        }
        else{
            element.style.display = "none";
        }
    }
</script>
Cualquier cosa grita!
__________________
Gracias por los puntos!

Saludes ;-)