Currently it validates to true(passes the test) even if username contains just text, or just number characters alone. I want the validation to only be true(Passed) if and only if the username contains both text and number characters and fail otherwise.
How do I implement that? Thank you.
function isUser(username)
{
var numaric = username;
for(var j=0; j<numaric.length; j++)
{
var alphaa = numaric.charAt(j);
var hh = alphaa.charCodeAt(0);
if ((hh > 96 && hh<123) || (hh > 64 && hh<91) == false) { //A-Z - a-z
} else if ((hh > 47 && hh<58) ==false){ //0-9
} else if (true == (hh > 96 && hh<123) || (hh > 64 && hh<91) || (hh > 47 && hh<58)) { //A~Z - a~z - 1~9
} else {
alert("Your Alpha Numeric Test Falid");
return false;
}
alert("Your Alpha Numeric Test passed");
return true;
}
}