I have a registration form that uses the jquery.validate.js link plugin. I researched but did not find a way to return an error when the client inserts an already valid email. What is the best alternative to solve my problem? Thanks in advance.
I have a registration form that uses the jquery.validate.js link plugin. I researched but did not find a way to return an error when the client inserts an already valid email. What is the best alternative to solve my problem? Thanks in advance.
Validator has a property called remote
that can be used in your case:
$( "#myform" ).validate({
rules: {
email: {
required: true,
email: true,
remote: {
url: "check-email.php",
type: "post",
data: {
email: function() {
return $("#email").val();
}
}
}
}
}
});
The result of the request (made to the check-email.php
file) must be true
or false
.
Font .