function form1_Validator(theForm) { if (theForm.nombres.value == "") { alert("Escriba un valor para el campo \"Nombres\"."); theForm.nombres.select(); return (false); } if (theForm.nombres.value.length < 3) { alert("Escriba correctamente sus nombres"); theForm.nombres.select(); return (false); } if (theForm.nombres.value.length > 30) { alert("Escriba como máximo 30 caracteres en el campo \"Nombres\"."); theForm.nombres.select(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz \t\r\n\f"; var checkStr = theForm.nombres.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Escriba sólo letras y espacios en el campo \"Nombres\"."); theForm.nombres.select(); return (false); } if (theForm.apellidos.value == "") { alert("Escriba sus \"Apellidos\"."); theForm.apellidos.select(); return (false); } if (theForm.apellidos.value.length < 3) { alert("Escriba correctamente sus apellidos"); theForm.apellidos.select(); return (false); } if (theForm.apellidos.value.length > 30) { alert("Escriba como mximo 30 caracteres en el campo \"Apellidos\"."); theForm.apellidos.select(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz \t\r\n\f"; var checkStr = theForm.apellidos.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Escriba sólo letras y espacios en el campo apellidos no se admiten ñ "); theForm.apellidos.select(); return (false); } if (theForm.mobile.value == "") { alert("Ingrese un teléfono de contacto."); theForm.mobile.select(); return (false); } if (theForm.mobile.value.length < 6) { alert("Escriba correctamente su telefono de contacto"); theForm.mobile.select(); return (false); } if (theForm.mobile.value.length > 10) { alert("Escriba correctamente su telefono de contacto."); theForm.mobile.select(); return (false); } var checkOK = "0123456789-/"; var checkStr = theForm.mobile.value; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } allNum += ch; } if (!allValid) { alert("Escriba solo n&umeros en el campo teléfono de contacto."); theForm.mobile.select(); return (false); } var actionform, selectIndex, lvalue; lvalue = document.form1.email.value if (!lvalue) { alert("Por favor escriba su dirección de email"); theForm.email.select(); return false; } if(lvalue.charAt(0) > '~') { alert("Please switch your Input Method Editor(IME) to the Half-Width ASCII setting and retype your e-mail address."); return false; } if((lvalue.indexOf('@') == -1) || (lvalue.indexOf('.') == -1)) { alert("Por favor escribe correctamente tu dirección de email. Ejemplo: alguien@loquesea.com."); theForm.email.select(); return false; } return (true); }