| 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/lib/manejaErrores.js"></script> |
| 12 | |
| 13 | </head> |
| 14 | |
| 15 | <body> |
| 16 | |
| 17 | <form id="formulario"> |
| 18 | |
| 19 | <h1>Agregar</h1> |
| 20 | |
| 21 | <p><a href="index.html">Cancelar</a></p> |
| 22 | |
| 23 | <p> |
| 24 | <label> |
| 25 | Nombre * |
| 26 | <input name="nombre"> |
| 27 | </label> |
| 28 | </p> |
| 29 | |
| 30 | <p> |
| 31 | <label> |
| 32 | Pasatiempo |
| 33 | <select name="pasId"> |
| 34 | <option value="">Cargando…</option> |
| 35 | </select> |
| 36 | </label> |
| 37 | </p> |
| 38 | |
| 39 | <p>* Obligatorio</p> |
| 40 | |
| 41 | <p><button type="submit">Agregar</button></p> |
| 42 | |
| 43 | </form> |
| 44 | |
| 45 | <script type="module"> |
| 46 | |
| 47 | import { descargaVista } from "./js/lib/descargaVista.js" |
| 48 | import { submitAccion } from "./js/lib/submitAccion.js" |
| 49 | |
| 50 | descargaDatos() |
| 51 | |
| 52 | async function descargaDatos() { |
| 53 | |
| 54 | await descargaVista("php/amigo-vista-agrega.php") |
| 55 | |
| 56 | formulario.addEventListener( |
| 57 | "submit", |
| 58 | event => submitAccion( |
| 59 | event, "php/amigo-agrega.php", formulario, "index.html" |
| 60 | ) |
| 61 | ) |
| 62 | |
| 63 | } |
| 64 | |
| 65 | </script> |
| 66 | |
| 67 | </body> |
| 68 | |
| 69 | </html> |