here is my code
function user(){
var result = null;
$("#div_user").removeClass().addClass('checking').text('Checking Username...').fadeIn(1000);
$.post("posts.php",{act:"signup",check:"user",username:$("#Username").val()},function(getResult){
result = getResult;
});
// check for user
if(result == "DONE"){
$("#div_user").fadeTo(200,0.1,function(){
$(this).html('Username exists!').removeClass().addClass('done').fadeTo(900,1);});
// user else
}else{
$("#div_user").fadeTo(200,0.1,function(){
$(this).html('Username already taken!').removeClass().addClass('error').fadeTo(900,1);});
return false;
}
}
What I want to do is if the username is valid or not taken yat then PHP page returns DONE value and I am using that value if it is done then add valid text in div if not then add invalid text in div and if it is invalid then the function should return false value and alert the user for changing the username, but function is not returning the value neither true not false.
Thanks
This post has been edited by noorahmad: 20 November 2009 - 09:56 PM

New Topic/Question
Reply


MultiQuote



|