Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/11/2009, 19:17
crucifijo
 
Fecha de Ingreso: septiembre-2003
Mensajes: 182
Antigüedad: 20 años, 8 meses
Puntos: 1
Pregunta Pasar el value de un checkbox a un text

Hola amigos tengo la siguiente duda al momento de seleccionar mi checkbox como hago para que el value de ese checkbox me aparezca en el text, segun yo trata de hacer asi pero me manda un error de undefined


<html>
<head>
<title>ejercicio 24</title>
</head>
<script language="javascript">
function deportes() {

if (document.formadeportes.deporte1.checcked)
var dep1 = document.formadeportes.deporte1.value;
document.formadeportes.c_deport.value=(dep1);
}
</script>
<body>
<table width="255" border="1" align="center">
<tr>
<td><form name="formadeportes" method="post" action="">
<p>
<input name="deporte1" type="checkbox" value="futbol" />
Futbol</p>
<p>
<input name="button" type="submit" value="validar" onclick="deportes()" />
</p>
<p>&nbsp;</p>
</form>
</td>
</tr>
</table>
</body>
</html>