Mostrar y ocultar formulario desde un checkbox
Si queremos ofrecer a nuestros visitantes la opcion de mostrar o ocultar campos de formulario, este script puede ser muy util. Al pulsar sobre el checkbox se muestra u oculta una lista desplegable. Ademas de utilizar javascrit utiliza css y layers o capas.
<html>
<head>
<title>CB Hide/Show</title>
<script type="text/javascript">
<!--
function showMe (it, box) {
var vis = (box.checked) ? "block" : "none";
document.getElementById(it).style.display = vis;
}
//-->
</script>
</head>
<body>
<h3 align="center"> This JavaScript shows how to hide divisions </h3>
<div id="div1" style="display:none">
<table border=1 id="t1">
<tr>
<td>i am here!</td>
</tr>
</table>
</div>
<form>
<input type="checkbox" name="c1" onclick="showMe('div1', this)">Show Hide Checkbox
</form>
</body>
</html>
- Compartir
- Inicie sesión o regístrese para comentar
- ¿Contenido Defectuoso?
- 2658 Lecturas

Comentarios Recientes
hace 4 días 55 mins
hace 4 días 3 horas
hace 1 semana 5 días
hace 1 semana 5 días
hace 1 semana 5 días
hace 2 semanas 1 hora
hace 2 semanas 16 horas
hace 2 semanas 2 días
hace 2 semanas 2 días
hace 2 semanas 2 días