I am running this bit of code to check if a username is available or not.
It makes the error message appear but it doesn't change the variable
if(document.getElementById('username').value.length > 2) {
v=$("#username");
$.post('../action/checkusername.php',{username:v.val().toLowerCase()},function(d){
if(d=='not-available'){
iserror = iserror + 1;
$('#warningbox').fadeIn("slow");
$('#usernamewarning2').show();
}
});
}