I am trying to write a code to match username and password. If both are right, it must be redirected to a new page and if it is wrong, it must give an alert message. When the password is correct and when I click on submit, it open the success message in a new tab, i want it to be displayed in the same tab.
function redirectPage(form) {
if (form.uname.value == 'test' && form.uname.value == 'test') {
window.open('login.html');
} else {
alert("Wrong Credentials, Try again")
}
PS
window.open('login.html','_self');
isnt working