Page 1 of 1

Username ajax w/ jquery validation (JSON syntax issue)

Posted: Wed Apr 22, 2009 1:04 am
by cohq82
Hi all,

I am using code below to call the /Account/CheckUserExist to check if #userData_Username is existed, then it will return TRUE.
'userData.Username': {
required: true,
minlength: 2,
remote: {
type: "GET",
async: false,
url: "/Account/CheckUserExist",
data: {
userName: function() {
return $("#userData_Username").val();
}
}
}
},

However, I need the return to be FALSE at "remote" when userName existed. The reason is that if username is existed, remote=true and it will pass validation. What can I do to reverse the boolean value in "remote"?

Any good advise on how to solve this username validation problem? I know it is classic.

Thanks