Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save diogoalexsmachado/0cfd20374779b50384d4a3b7dfc68298 to your computer and use it in GitHub Desktop.
Save diogoalexsmachado/0cfd20374779b50384d4a3b7dfc68298 to your computer and use it in GitHub Desktop.
completeemail jquery validator method
// validação email com mais segurança
$.validator.addMethod("completeemail",
function(value, element) {
return /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(value);
},
"O endereço e-mail não é válido"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment