1 | <!DOCTYPE html> |
2 | <html lang="es"> |
3 | |
4 | <head> |
5 | |
6 | <meta charset="UTF-8"> |
7 | <meta name="viewport" content="width=device-width"> |
8 | |
9 | <title>Agregar</title> |
10 | |
11 | <script type="module" src="js/configura.js"></script> |
12 | <script type="module" src="lib/js/muestraError.js"></script> |
13 | <script type="module" src="js/bd/pasatiempoAgrega.js"></script> |
14 | |
15 | </head> |
16 | |
17 | <body> |
18 | |
19 | <form id="forma" onsubmit=" |
20 | event.preventDefault() |
21 | // Lee el nombre, quitándole los espacios al inicio y al final. |
22 | const PAS_NOMBRE = forma.nombre.value.trim() |
23 | const modelo = { PAS_NOMBRE } |
24 | pasatiempoAgrega(modelo) |
25 | .then(json => location.href = 'index.html') |
26 | .catch(muestraError)"> |
27 | |
28 | <h1>Agregar</h1> |
29 | |
30 | <p><a href="index.html">Cancelar</a></p> |
31 | |
32 | <p> |
33 | <label> |
34 | Nombre * |
35 | <input name="nombre"> |
36 | </label> |
37 | </p> |
38 | <p>* Obligatorio</p> |
39 | <p><button type="submit">Agregar</button></p> |
40 | |
41 | </form> |
42 | |
43 | </body> |
44 | |
45 | </html> |