Ver Mensaje Individual
  #21 (permalink)  
Antiguo 01/12/2002, 21:45
Avatar de Kaopectate
Kaopectate
Colaborador
 
Fecha de Ingreso: diciembre-2001
Ubicación: Curaçao (Antillas Holandesas)
Mensajes: 3.179
Antigüedad: 22 años, 3 meses
Puntos: 38
21.- CheckBox

P: ¿Como puedo comprobar si un checkbox está seleccionado?

R: [ver ejemplo]

Código PHP:
<html>
 <
head>
  <
script language="JavaScript">
   function 
estado(){
    if (
document.frm.chk.checked)
     
alert("Marcado");
    else
     
alert("Desmarcado");
   }
  
</script>
 </head>
 <body>
  <form name="frm" onClick="estado()">
   <input type="checkbox" name="chk">Selector<br>
  </form>
 </body>
</html> 

Última edición por Kaopectate; 23/12/2002 a las 23:08