I'm trying to figure out how this jquery.each() could work on IE 7:
var todosOsCampos = $(".validate_mail");
jQuery.each(todosOsCampos, function(){
//Verifica e-mail
email = $(this).val();
if(email!=''){
er = /^[a-zA-Z0-9][a-zA-Z0-9\._-]+@([a-zA-Z0-9\._-]+\.)[a-zA-Z-0-9]{2}/;
if(!er.exec(email)) {
erro = 1;
$(this).css("border", "solid 1px #F00");
}
}
});
I'm checking the e-mail but on Ie7 is not working properly
I Thought the problem was solved but I was wrong. I've changed the code like the example of user2246674 asked me to do.
var todosOsCampos = $(".validate_mail");
todosOsCampos.each(function(){
email = this.value;
console.log(email);
if(email!=''){
er = /^[a-zA-Z0-9][a-zA-Z0-9\._-]+@([a-zA-Z0-9\._-]+\.)[a-zA-Z-0-9]{2}/;
if(!er.exec(email)) {
erro = 1;
this.style.border = "solid 1px #F00";
}
}
});
But the IE7 is returning the follow message:
Problem with this web page might prevent it from being displayed properly or functioning properly. In the future...
And then I hit the show details button:
Line: 528 Char: 5 Error: Object does not support this property or method
Code: 0
Line 528 correspond to this
email = this.value;
Someone could help me?