I am using the 'remote' parameter validate jQuery to access a script that checks that the email exists or not. I checked with Firebug and the request is made, but I can not return and error message in the field. Below is my Javascript and PHP code:
Javascript:
mail: {
required: true,
email: true,
remote: {
url: 'ajax/usuario.checar.mail.php',
type: 'POST'
}
}
PHP:
if($checar > 0)
{
// If e-mail exists, error message below
echo "E-mail já cadastrado!";
exit;
}
// If e-mail not exists, return true
echo "true";