<div class="container"> <form method="POST" name="formLogin" action="logeado.html" onsubmit="login(userName,password)"> USERNAME<br> <input type="text" name="userName" placeholder="Nombre de usuario"><br> PASSWORD<br> <input type="text" name="password" placeholder="Contraseña"> <br> <input type="submit" name="btnLogin" value="Ingresar" onsubmit="login"> </form> </div>
It's something simple but I just want to make it work, the issue is that if username and password are the same I want to redirect to "logeado.html", otherwise I want to stay in the current page that is "login. html "and send me an error alert. I am using visual code with html5. I hope you can help me, thank you very much!