go to another page html with javascript
i have two files ;
login.html : simple html5 file with a form :
<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>
than, my javascript file :
function verif(inputtxt) {
var pwd = "123456";
if (inputtxt.value.match(pwd)) {
window.location.href = 'Test.html' ;
} else {
alert('Code erron\351 ! ');
return false;
}
}
now my problem is : I want when i enter my pwd , if it's false the box
message erreur appears (it appears i don't have a problem with that) and
if not i go the next page ... which it doesn't work for me .
Please help , i'm stuck with that for two days now..
No comments:
Post a Comment