I use simple js email validation like:
function validation(email) {
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
return reg.test(email);
}
function check(){
if ($("#subemail").hasClass("bad")) {
var subemail = $("#subemail").val();
if((subemail!=0)&&validation(subemail)) {
$("#subemail").css('background','transparent').css('color','#3b3b3b');
$('.arrow').css('visibility','hidden');
}
else {
$("#subemail").css('background','url(img/red.png)').css('color','white');
$('.arrow').css('visibility','visible');
}
}
}
everything works fine with Firefox but while doing it in Chrome or Opera it always return false