If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Login Form in Javascript

Hey guys i am trying to create a login form with html and javascript and everything is working except that i am not able to implement maximum attempts to this. It tried nested ifs and for too but didn't succeed.In the below code i am trying to implement maximum 3 attempts of wrong username or password.

There is no point in imposing a limit to the number of password attempts as the user can simply close the page, reopen it and start again.

Not if it's done properly server side. I think you'll find most if not all online banks will lock out users after 3 failed login attempts after which you have to physically contact the bank and jump through several hoops to prove you are who you say you are before they will re-activate your online access to your accounts. (The 2 banks I bank with both do)

Not if it's done properly server side. I think you'll find most if not all online banks will lock out users after 3 failed login attempts after which you have to physically contact the bank and jump through several hoops to prove you are who you say you are before they will re-activate your online access to your accounts. (The 2 banks I bank with both do)

Yes indeed. But we are talking about a beginner's Javascript. There is no point - it is futile - in limiting the number of attempts in that situation.

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.