Skip to content

@vcamaral /form.js
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Remote validation with jQuery validate plugin
$("#form-leads").validate({
rules: {
email: {
required: true,
email: true,
remote: "verifica_email.php"
}
},
messages: {
email: {
remote: "Este email já está cadastrado."
}
}
});
<?php
require_once "config.php";
$email = mysql_real_escape_string($_GET["email"]);
$sql = "SELECT * FROM leads WHERE email = '$email'";
$query = mysql_query($sql);
if(mysql_num_rows($query) > 0) {
echo "false";
} else {
echo "true";
}
mysql_close($conn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.