Skip to content

Commit

Permalink
Update registro.html
Browse files Browse the repository at this point in the history
Se creo un script al final con una funcion de validacion para el nombre
  • Loading branch information
ConraPal authored May 18, 2024
1 parent 7e26b58 commit 50bb59c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions registro.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<h2 class="form-text-title">Formulario de registro</h2>
<p class="form-text-p">Completa los campos para suscribirte:</p>

<form class="form-text form-content" action="https://formspree.io/f/xoqgpdyk" method="post">
<form class="form-text form-content" action="https://formspree.io/f/xoqgpdyk" method="post" onsubmit="return validacion()">
<label class="label-register" for="nombre">Nombre:</label>
<input type="text" class="input-register" name="nombre" placeholder="Ingrese nombre..."><br><br>
<input type="text" class="input-register" name="nombre" id="nombre" placeholder="Ingrese nombre..."><br><br>
<label class="label-register" for="apellido">Apellido:</label>
<input type="text" class="input-register" name="apellido" placeholder="Ingrese apellido..."><br><br>
<label class="label-register label-date" for="fecha_de_nacimiento">Fecha de nacimiento:</label>
Expand Down Expand Up @@ -103,7 +103,18 @@ <h3 class="title-footer">Follow Us</h3>

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/slick/slick.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>

<script>
function validacion(){
valor = document.getElementById("nombre").value;
if (valor == null || valor.length == 0){
document.getElementById("mensaje").innerHTML = "Tenes que completar el nombre!";
elemento = document.getElementById("nombre");
elemento.focus();
return false;
}
return true;
}
</script>
</body>
</html>

Expand Down

0 comments on commit 50bb59c

Please sign in to comment.