Tema: checkbox
Ver Mensaje Individual
  #7 (permalink)  
Antiguo 02/10/2006, 15:14
Avatar de mdk
mdk
 
Fecha de Ingreso: noviembre-2002
Mensajes: 531
Antigüedad: 21 años, 6 meses
Puntos: 11
y como lo asigno a un determinado formulario? lo tengo puesto asi y no me funciona..

Código PHP:

<?
echo "checkbox valor: ".$cheked;

?>
<html> 
 <head> 
  <SCRIPT LANGUAGE="JavaScript"> 

  <!--  
   image1 = new Image(); 
   image1.src = "musika/upfiles/unchecked.gif"; 
   image2 = new Image(); 
   image2.src = "musika/upfiles/checked.gif"; 

   function cambiar(id) { 
    if ( document.getElementById('checkbox_'+id).src != image1.src ) { 
     document.getElementById('checkbox_'+id).src = image1.src; 
     var cheked = false;


    } else { 
     document.getElementById('checkbox_'+id).src = image2.src; 
     var cheked = true;
       } 
   } 
  --> 
  </SCRIPT> 
 </head> 
 <body> 
<form enctype="multipart/form-data" method="post" action="index.php">
       <a href="javascript:cambiar('1')"><img id="checkbox_1" name="checkbox_1" value="si" src="musika/upfiles/unchecked.gif" width="14" height="16" border="0"></a>  
        <p><input type="submit" value="Enviar" name="B1"></p>
    </form>
 </body> 
</html>
__________________
SoY Lo Ke VeS iNKLuSo KuAnDo No Me VeS ;)

Última edición por mdk; 02/10/2006 a las 15:19