I\'m new to JQuery and attempting to write a script to check username availability. My problem is that no matter what I type, I always get back \"This username is already in
This works just check made the same code
jQuery.validator.addMethod("usernameCheck", function(username) {
var isSuccess = false;
$.ajax({ url: "checkusr.php",
data: "username=" + username,
async: false,
success:
function(msg) {
if(msg ==0)
{
isSuccess=false;
}
else
{
isSuccess=true;
}
}
});
return isSuccess;
},"Username not available");
PHP SIDE CODE
if ($obj->checkUsername($_GET['username'],"artist")> 0 )
{
echo 0;
}
else
{
echo 1;
}
}