Last active
August 29, 2015 14:14
-
-
Save porfidev/8a84b037522ef45f3725 to your computer and use it in GitHub Desktop.
Codigo que no se por que surgio, pero xD fue hace años.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function verificar() { | |
//Verifica la existencia de los elementos | |
if (document.formaltas.curp.value.length == 0) { | |
alert('Falta ingresar el Curp') | |
document.formaltas.curp.focus() | |
} | |
else { | |
v1 = 0; | |
if (document.formaltas.nombre.value.length == 0) { | |
alert('Falta el Nombre del Empleado') | |
document.formaltas.nombre.focus() | |
} | |
else { | |
v2 = 0; | |
if (document.formaltas.apellido_p.value.length == 0) { | |
alert('Falta el apellido Paterno') | |
document.formaltas.apellido_p.focus() | |
} | |
else { | |
v3 = 0; | |
if (document.formaltas.apellido_m.value.length == 0) { | |
alert('Falta el apellido Materno') | |
document.formaltas.apellido_m.focus() | |
} | |
else { | |
v4 = 0; | |
if (document.formaltas.dia.value == 'null') { | |
alert('Falta elegir el dia de Nacimiento') | |
document.formaltas.dia.focus() | |
} | |
else { | |
v5 = 0; | |
if (document.formaltas.mes.value == 'null') { | |
alert('Falta elegir el mes de Nacimiento') | |
document.formaltas.mes.focus() | |
} | |
else { | |
v6 = 0; | |
if (document.formaltas.ano.value == 'null') { | |
alert('Falta elegir el año de Nacimiento') | |
document.formaltas.ano.focus() | |
} | |
else { | |
v7 = 0; | |
if (document.formaltas.estado_civil.value == 'null') { | |
alert('Falta el estado Civil') | |
document.formaltas.estado_civil.value.focus() | |
} | |
else { | |
v8 = 0; | |
if (document.formaltas.profesion.value == 'null') { | |
alert('Falta elegir una Profesion') | |
document.formaltas.profesion.value.focus() | |
} | |
else { | |
v9 = 0; | |
if (document.formaltas.cedula.value.length == 0) { | |
alert('Falta ingresar la Cedula') | |
document.formaltas.cedula.value.focus() | |
} | |
else { | |
v10 = 0; | |
if (document.formaltas.mail.value.length <= 4) { | |
alert('Falta un Correo Electronico valido') | |
document.formaltas.mail.focus() | |
} | |
else { | |
v11 = 0; | |
if (document.formaltas.mail_company.value == "null") { | |
alert('Falta elegir una compañia de Servicio de Correo') | |
document.formaltas.mail_company.focus() | |
} | |
else { | |
v12 = 0; | |
if (document.formaltas.movil.value.length == 0) { | |
alert('Falta ingresar el numero telefono') | |
document.formaltas.movil.focus() | |
} | |
else { | |
v13 = 0; | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
//Luego de la verificacion hacemos el envio del formulario | |
if (v1 == 0 && v2 == 0 && v3 == 0 && v4 == 0 && v5 == 0 && v6 == 0 && v7 == 0 && v8 == 0 && v9 == 0 && v10 == 0 && v11 == 0 && v12 == 0) { | |
if (confirm("Los datos ingresados son correctos?")) | |
document.formaltas.submit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment