diff options
Diffstat (limited to 'templates/js')
-rw-r--r-- | templates/js/formulario.js | 64 | ||||
-rw-r--r-- | templates/js/formulario.min.js | 3 |
2 files changed, 0 insertions, 67 deletions
diff --git a/templates/js/formulario.js b/templates/js/formulario.js deleted file mode 100644 index 00bd9a8..0000000 --- a/templates/js/formulario.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -@licstart The following is the entire license notice for the -JavaScript code in this page. - -Copyleft 2019 | Heckyel - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU General Public License for more details. - -@licend The above is the entire license notice -for the JavaScript code in this page. -*/ - -(function(){ - let formulario = document.getElementById('formulario'), - nombre = formulario.nombre, - correo = formulario.correo, - mensaje = formulario.mensaje, - error = document.getElementById('error'); - - function validarNombre(e){ - if(nombre.value == '' || nombre.value == null){ - console.info('Por favor completa el nombre'); - error.style.display = 'block'; - error.innerHTML = error.innerHTML + '<li>Por favor completa el nombre</li>'; - e.preventDefault(); - } - } - - function validarCorreo(e){ - if(correo.value == '' || correo.value == null){ - console.info('Por favor completa el correo'); - error.style.display = 'block'; - error.innerHTML = error.innerHTML + '<li>Por favor completa el correo</li>'; - e.preventDefault(); - } - } - - function validarMensaje(e){ - if(mensaje.value == '' || mensaje.value == null){ - console.info('Por favor completa el mensaje'); - error.style.display = 'block'; - error.innerHTML = error.innerHTML + '<li>Por favor completa el mensaje</li>'; - e.preventDefault(); - } - } - - function validarFormulario(e){ - error.innerHTML = ''; - error.style.display = 'none'; - validarNombre(e); - validarCorreo(e); - validarMensaje(e); - } - - formulario.addEventListener('submit', validarFormulario); -}()); diff --git a/templates/js/formulario.min.js b/templates/js/formulario.min.js deleted file mode 100644 index d58b9d2..0000000 --- a/templates/js/formulario.min.js +++ /dev/null @@ -1,3 +0,0 @@ -// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later -!function(){function e(e){""!=a.value&&null!=a.value||(console.info("Por favor completa el nombre"),c.style.display="block",c.innerHTML=c.innerHTML+"<li>Por favor completa el nombre</li>",e.preventDefault())}function l(e){""!=t.value&&null!=t.value||(console.info("Por favor completa el correo"),c.style.display="block",c.innerHTML=c.innerHTML+"<li>Por favor completa el correo</li>",e.preventDefault())}function n(e){""!=i.value&&null!=i.value||(console.info("Por favor completa el mensaje"),c.style.display="block",c.innerHTML=c.innerHTML+"<li>Por favor completa el mensaje</li>",e.preventDefault())}function o(o){c.innerHTML="",c.style.display="none",e(o),l(o),n(o)}var r=document.getElementById("formulario"),a=r.nombre,t=r.correo,i=r.mensaje,c=document.getElementById("error");r.addEventListener("submit",o)}(); -// @license-end |