| 1 | <!DOCTYPE html> |
| 2 | <html lang="es" class="light dark"> |
| 3 | |
| 4 | <head> |
| 5 | |
| 6 | <meta charset="UTF-8"> |
| 7 | <title>Select - PWA con Formulario</title> |
| 8 | |
| 9 | <script type="module" src="js/registraServiceWorker.js"></script> |
| 10 | <script type="module" src="libclienteweb/manejaErrores.js"></script> |
| 11 | |
| 12 | <meta name="viewport" content="width=device-width"> |
| 13 | <meta name="theme-color" content="#fffbfe"> |
| 14 | <link rel="icon" sizes="32x32" href="favicon.ico"> |
| 15 | <link rel="manifest" href="site.webmanifest"> |
| 16 | <link rel="stylesheet" href="css/material-symbols-outlined.css"> |
| 17 | <link rel="stylesheet" href="material-tokens/css/baseline.css"> |
| 18 | <link rel="stylesheet" href="css/estilos.css"> |
| 19 | <script src="ungap/es.js"></script> |
| 20 | |
| 21 | <script type="module" src="libmde/md-app-bar.js"></script> |
| 22 | <script type="module" src="js/nav-tab-fixed.js"></script> |
| 23 | <script type="module" src="libmde/md-select-menu.js"></script> |
| 24 | <script type="module" src="libmde/md-options-menu.js"></script> |
| 25 | |
| 26 | <link rel="stylesheet" href="libmde/md-tab.css"> |
| 27 | <link rel="stylesheet" href="libmde/md-menu.css"> |
| 28 | <link rel="stylesheet" href="libmde/md-filled-text-field.css"> |
| 29 | <link rel="stylesheet" href="libmde/md-filled-button.css"> |
| 30 | <link rel="stylesheet" href="css/transicion_pestanas.css"> |
| 31 | |
| 32 | </head> |
| 33 | |
| 34 | <body> |
| 35 | |
| 36 | <form id="formulario" novalidate> |
| 37 | |
| 38 | <md-app-bar adicional="tab"> |
| 39 | |
| 40 | <h1>Select</h1> |
| 41 | |
| 42 | </md-app-bar> |
| 43 | |
| 44 | <nav-tab-fixed id="tab"></nav-tab-fixed> |
| 45 | |
| 46 | <section> |
| 47 | |
| 48 | <p> |
| 49 | <span id="etiquetaGrupo" class="md-filled-text-field" accesskey="G"> |
| 50 | <md-select-menu name="grupo" required value="IC21" |
| 51 | aria-labelledby="etiquetaGrupo" |
| 52 | options="opcionesDeGrupo"></md-select-menu> |
| 53 | <span>Grupo *</span> |
| 54 | <small id="supportingGrupo">Obligatorio</small> |
| 55 | </span> |
| 56 | </p> |
| 57 | |
| 58 | <p> |
| 59 | <button class="md-filled-button" style="width: 100%;">Enviar</button> |
| 60 | </p> |
| 61 | |
| 62 | </section> |
| 63 | |
| 64 | <md-options-menu id="opcionesDeGrupo" aria-label="Opciones de grupo"> |
| 65 | <span data-value="" title="Selecciona opción"></span> |
| 66 | <span data-value="IC21">IC-21</span> |
| 67 | <span data-value="IC22">IC-22</span> |
| 68 | <span data-value="IC23">IC-23</span> |
| 69 | </md-options-menu> |
| 70 | |
| 71 | </form> |
| 72 | <script type="module"> |
| 73 | |
| 74 | import { muestraTextoDeAyuda } from "./libclienteweb/muestraTextoDeAyuda.js" |
| 75 | |
| 76 | formulario.grupo.addEventListener("input", copiaMensajes) |
| 77 | formulario.addEventListener("submit", procesa) |
| 78 | |
| 79 | function copiaMensajes() { |
| 80 | muestraTextoDeAyuda(formulario.grupo, supportingGrupo, "Obligatorio") |
| 81 | } |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | function procesa(evt) { |
| 87 | copiaMensajes() |
| 88 | if (!formulario.grupo.validity.valid) { |
| 89 | evt.preventDefault() |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | </script> |
| 94 | |
| 95 | </body> |
| 96 | |
| 97 | </html> |