Foros del Web » Programando para Internet » Javascript »

Codigo falla en firefox

Estas en el tema de Codigo falla en firefox en el foro de Javascript en Foros del Web. Buenas a todos estoy utilizando un codigo para validar el ingreso de mail correcto, en IE y Opera me funciona 10 puntos, ahora en firefox ...
  #1 (permalink)  
Antiguo 01/02/2007, 07:55
Avatar de iceman_cml  
Fecha de Ingreso: diciembre-2005
Ubicación: Rosario
Mensajes: 63
Antigüedad: 18 años, 4 meses
Puntos: 0
Codigo falla en firefox

Buenas a todos estoy utilizando un codigo para validar el ingreso de mail correcto, en IE y Opera me funciona 10 puntos, ahora en firefox me lo cuelga.
Les dejo el codigo en cuestión por ahí ven algo q yo no...

Código:
function EmailCheck (emailFld) {
var emailStr= document.getElementById(emailFld).value
var checkTLD=1;
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
if (emailStr=="") {
return true;
} else {
var email = document.getElementById(emailFld);
email.focus();
alert("No se ha ingresado un e-mail válido");



return false;
}
}
var user=matchArray[1];
var domain=matchArray[2];
for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
var email = document.getElementById(emailFld);
email.focus();
alert("Se han encontrado caracteres no válidos");
return false;
}
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
var email = document.getElementById(emailFld);
email.focus();
alert("Se han encontrado caracteres no válidos");
return false;
}
}
if (user.match(userPat)==null) {
var email = document.getElementById(emailFld);
email.focus();
alert("El nombre de usuario no parece válido");
return false;
}
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
var email = document.getElementById(emailFld);
email.focus();
alert("IP no parece válida");
return false;
}
}
return true;
}
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
var email = document.getElementById(emailFld);
email.focus();
alert("Dominio no parece válido");
return false;
}
}
if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {
var email = document.getElementById(emailFld);
email.focus();
alert("Terminación no conocida del dominio");
return false;
}
if (len<2) {
var email = document.getElementById(emailFld);
email.focus();
alert("No se encuentra dominio");
return false;
}
return true;
}
__________________
www.nimbosolutions.com.ar
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:34.