Re: enviar checkbox a t ravés de formularios.

From: Date: Fri, 13 Oct 2006 14:56:03 +0000
Subject: Re: enviar checkbox a t ravés de formularios.
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-59818@lists.php.net to get a copy of this message
algo rápido : esto debería funcionarte /***********pagina1.php *********/ <html> <body> <form name="form1" method="post" action="pagina2.php"> <table border="1"> <tr>
     <td width="24%">1</td>
     <td width="76%"><input name="cbx1" type="checkbox"  value="1"></td>
</tr> <tr>
     <td>2</td>
     <td><input name="cbx2" type="checkbox"  value="2"></td>
</tr> <tr>
     <td>3</td>
     <td><input name="cbx3" type="checkbox" value="3"></td>
</tr> <tr>
     <td colspan="2"><input type="submit" name="Submit" value="Enviar"></td>
</tr> </table> </form> </body> </html> /*********** pagina2.php *************/ <? $i=1; while ($i <= 3){
    $cbx ="cbx".$i;
        $cbx = $$cbx;
        if ($cbx == true){
          echo "Has seleccionado ".$cbx ;
          echo "<br>";
        }
$i++; } ?> ----- Original Message ----- From: "German Piqué" <extremdur2@gmail.com> To: "Php-es" <php-es@lists.php.net> Sent: Friday, October 13, 2006 5:11 AM Subject: [PHP-ES] enviar checkbox a través de formularios.
Buenas, siguiendo en la línea de mi último mail, me he encontrado con un "bonito" problema. Mi formulario autogenerado en php funciona correctamente. Llama a la pagina que tiene que llamar, pero a la hora de pasar los valores, me pasa solo el del botón de submit, ninguno de los checkbox (y antes de que pregunteis, sí, había seleccionado a uno) Alguien se ha encontrado con este problema o algo parecido? Necesito los datos conseguidos en los values de los checkboxs activados. En fin, gracias a todos los que intenteis ayudarme :) -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
-------------------------------------------------------------------------------- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.408 / Virus Database: 268.13.2/472 - Release Date: 11/10/2006 -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.

« previous php.general.es (#59818) next »