This question already has an answer here:
In my sign in page I made it so that the page doesn't need to reload when the wrong password is typed (similar to Google's). What should happen when the wrong password is typed? Right now I have text beneath the password field that says "wrong password or username" in red. I personally don't like red too often because I don't want the user to feel like something bad happened. Also should I clear the password field after they typed it in wrong? The only reason I can see this being bad is if the user wasn't sure of the last character (e.g. forget there's a 1 at the end of the password).
EDIT:One thing I didn't see in other questiosn is when should the message that the username/password is incorrect go away? For example, assuming the password field is automatically cleared after a wrong password, should the "wrong password" message disapear after the first character is entered in the password field?