Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (nombre.trim() === "" || email.trim() === "") {
- <div style="text-align:center;">
- <h3>Solicitar informaciĆ³n</h3>
- <form method="POST" id="formulario" onsubmit=" validacion(); return false;">
- Nombre:<br><input type="text" name="name" id="campoNombre"><br>
- Email:<br><input type="text" name="mail" id="campoEmail"><br><br>
- <input type="submit" value="Solicitar informaciĆ³n" name="submit" id="submit">
- </form>
- </div>
- <div>
- <p id="warning">No se enviaron los datos</p>
- </div>
- document.getElementById("warning").style.display = 'none';
- function validacion(e) {
- let nombre = document.getElementById("campoNombre").value;
- let email = document.getElementById("campoEmail").value;
- if (nombre === "" || email === "" || nombre.length > 0 || email.length > 0) {
- document.getElementById("warning").style.display = 'block';
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement