2
Good evening, I’m finalizing a form check and I’ve locked on at one point, maybe by the way they wrote the code of my work I can’t use jquery validate
, then I have trouble checking a field of input
has a typed e-mail.
I made a validation code that counts the characters:
//verifica email
$("#txtEmail").blur(function() {
if ($("#txtEmail").val().length < 10) {
$("#txtEmail").css('background', '#fb4745');
$("#alertEmail").show('fast')
$("#alertEmail").text('Preencha o campo com um email valido');
}
if ($("#txtEmail").val().length >= 10) {
$("#txtEmail").css('background', '#6ebe51');
$("#alertEmail").hide('fast');
}
});
My question is: can you make a code that detects if the email field is formed by a string + @ + string? Thank you for your attention!
Very good!! Thank you!!!
– Mauricio Hartmann