I have two files. One is login.html
which is a simple html5 file with a form.
HTML
<form method=post action= name=form1>entre the pasword:
<input type=password name=code placeholder=code maxlength=6>
<p class=submit>
<input type=submit name=commit value=send onclick=verif(document.form1.code)>
</p>
</form>
Second is my javascript file with the below code:
function verif(inputtxt) {
var pwd = 123456;
if (inputtxt.value.match(pwd)) {
window.location.href = 'Test.html';
} else {
alert('Code erron351 ! ')
return false;
}
}
Now my problem is that when I enter my password, if it is wrong the alert message indicating an error should appear (it appears and I don't have a problem with that) and if it is correct, I should get redirected to the next page. The second part doesn't work for me.
Please help, I'm stuck with that for two days now..