문제

I've currently created this code to check for an array (For the Login) before moving to the next array to corroborate the password. For some reason, there's a specific instance within the code preventing a javascript prompt or alert box from popping up. I've done trial and error and it appears to be an issue with the while statement overall. But, further testing is not revealing anything obvious.

while(loginSelection != true)
{
    alert("Welcome to the Ballot Design Process");
    var loginUsername = prompt("Please enter in your username: ");

        for(checkFor; checkFor <= userID.length; checkFor++)
        {
            if(loginID == userID(count))
            {   
                if(user_password == password(checkFor)
                {
                    loginPassword = prompt("Please enter in your password: ");
                }
            }
            else
            {
                arrayPos += 1;

                if(arrayPos == userID.length-1)
                    alert("Sorry, you did not enter a correct identification.");
            }
        }

}
도움이 되었습니까?

해결책

You are missing a closing bracket on your if statement:

 if(user_password == password(checkFor)) <<<<<

I recommend checking your javascript code with something like http://www.jshint.com if your debugger/IDE isnt picking it up.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top