I have a problem with jQuery remote validation. I am checking if email is registered, remote validation works, but it display only values - true or false and I cant submit the form than.
jQuery code :
$("#form").validate({
rules: {
email: {
required: true,
email: true,
remote: "check-email.php"
}
}
});
check-mail.php code :
$email = trim(strtolower($_REQUEST['email']));
$checkemail = mysql_query("SELECT * FROM users WHERE email = '".$email."'");
if(mysql_num_rows($checkemail) == 1)
{
$valid = 'false';
}
else
{
$valid = 'true';
} //end of $checkemail if statemant
echo json_encode($valid);