I know this is possible, but I am confused about how this works. I searched online for how this is done and I think I missed something in the process
I have this jQuery code:
$("#Contact_Info").validate({
rules: {
username: {
required: true,
minlength: 6,
remote: "check-username.php"
}
},
messages: {
username:{
remote: "This username is already taken! Try another."
}
}
});
How can I write my php page to talk with jQuery code?
So far, I:
$name = mysql_real_escape_string($name);
$query = "SELECT USERNAME FROM T_MEMBER WHERE USERNAME='$name';";
$res = mysql_query($query);
if (mysql_num_rows($res) > 0) {
return false;
} else
return true;
How to get $ name variable from javascript? Should I set "remote" as POST?
Thanks in advance, Ian McCullough
source
share