Tema: Checkbox
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/10/2006, 09:20
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 3 meses
Puntos: 772
Hola oscar2001601

Prueba este código:
Código PHP:
<html>
<
head>
<
script>
function 
anadir(obj) {
  if (
obj.checked)
    
obj.form.txt.value += obj.value;
  else {
    
texto obj.form.txt.value;
    
texto texto.split(obj.value).join('');
    
obj.form.txt.value texto;
  }  
}
</script>
</head>
<body>
<form>
<input type="checkbox" value="pepe" onclick="anadir(this)" />
<input type="checkbox" value="paco" onclick="anadir(this)" />
<input type="checkbox" value="juan" onclick="anadir(this)" />
<input type="hidden" name="txt" />
</body>
</html> 
Saludos,