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="lib/js/consumeJson.js"></script> |
12 | <script type="module" src="lib/js/submitForm.js"></script> |
13 | <script type="module" src="lib/js/muestraObjeto.js"></script> |
14 | <script type="module" src="lib/js/muestraError.js"></script> |
15 | |
16 | </head> |
17 | |
18 | <body onload="consumeJson('srv/pasatiempo-options.php') |
19 | .then(options => muestraObjeto(document, options.body)) |
20 | .catch(muestraError)"> |
21 | |
22 | <form onsubmit="submitForm('srv/amigo-agrega.php', event) |
23 | .then(modelo => location.href = 'index.html') |
24 | .catch(muestraError)"> |
25 | |
26 | <h1>Agregar</h1> |
27 | |
28 | <p><a href="index.html">Cancelar</a></p> |
29 | |
30 | <p> |
31 | <label> |
32 | Nombre * |
33 | <input name="nombre"> |
34 | </label> |
35 | </p> |
36 | |
37 | <p> |
38 | <label> |
39 | Pasatiempo |
40 | <select name="pasId"> |
41 | <option value="">Cargando…</option> |
42 | </select> |
43 | </label> |
44 | </p> |
45 | |
46 | <p>* Obligatorio</p> |
47 | |
48 | <p><button type="submit">Agregar</button></p> |
49 | |
50 | </form> |
51 | |
52 | </body> |
53 | |
54 | </html> |