Foros aprenderaprogramar.com

Aprender a programar => Aprender a programar desde cero => Mensaje iniciado por: Znoifju en 03 de Mayo 2016, 03:26

Título: HTML. Checkbox, radio buttons y listas desplegables en formularios CU00723B
Publicado por: Znoifju en 03 de Mayo 2016, 03:26
Solución al ejercicio pedido a la clase CU00723B del curso básico de programación web desde cero con HTML.

Código: [Seleccionar]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Formularios 02 - aprenderaprogramar.com</title>
</head>
<body>
<h1 style="text-align: center;">Preferencias musicales</h1>
<form method="get" action="http://aprenderaprogramar.com/action.php">
<h3>Seleccione Generos</h3>
<input name="rock" type="checkbox"/>Rock
<br/><input name="pop" type="checkbox"/>Pop
<br/><input name="jazz" type="checkbox"/>Jazz
</form>
<form method="get" action="http://aprenderaprogramar.com/action.php">
<h3>Seleccione Edad</h3>
<input name="edad" type="radio" value="1217"/>12 - 17 años
<br/><input name="edad" type="radio" value="1835"/>18 - 35 años
<br/><input name="edad" type="radio" value="3665"/>36 - 65 años
</form>
<form method="get" action="http://aprenderaprogramar.com/action.php">
<h3>Seleccione sus Bandas Favoritas/Cantantes</h3>
(Mantener Presionado CTRL para seleccionar varias)
<br/><select multiple name="musica[]" style="height: 220px; width: 20%">
<optgroup label="Rock">
<option>AC/DC</option>
<option value="rhcp">Red Hot Chili Peppers</option>
<option>Nirvana</option>
</optgroup>
<optgroup label="Pop">
<option value="patd">Panic! at the Disco</option>
<option value="asaint">All Saints</option>
<option value="onerep">OneRepublic</option>
</optgroup>
<optgroup label="Jazz">
<option value="masch">María Schneider</option>
<option value="billfri">Bill Frisell</option>
<option value="jhnz">John Zorn</option>
</optgroup>
</select>
</form>
</body>
</html>
Título: Re:Entrega nº23 del Tutorial básico del programador web: HTML desde cero. CU00723B
Publicado por: pedro,, en 03 de Mayo 2016, 09:59
Hola Znoifju.

El ejercicio pedía crear un formulario y tu has creado tres. Además en todo formulario debería de haber un botón para enviarlo, son dos cosillas fáciles de cambiar para que el ejercicio quede como pedía el enunciado.

Saludos. ;D