Hasło jest poprawne? następnie przekieruj [duplikat]
Możliwy duplikat:
Przekierowanie hasła HTML
Mam więc ten kod i muszę go przekierować tylko po dodaniu poprawnego hasła. Jedynym problemem jest to, że nie wiem, co dodać, co sprawi, że tylko przekieruje, jeśli hasło jest „cześć”. . Po prostu muszę wiedzieć, co dodać i gdzie go dodać.
Sooo: Przekierowuje, jeśli wpisano „hello” w polu hasła. Nie robi nic, jeśli cokolwiek innego zostanie umieszczone w polu hasła.
<div class="wrapper">
<form class="form1" action="http://google.com">
<div class="formtitle">Enter the password to proceed</div>
<div class="input nobottomborder">
<div class="inputtext">Password: </div>
<div class="inputcontent">
<input type="password" />
<br/>
</div>
</div>
<div class="buttons">
<input class="orangebutton" type="submit" value="Login" />
</div>
</div>
Mam nadzieję, że było to jasne i zrozumiałe.
AKTUALIZACJA: Wprowadź hasło, aby kontynuować
<div class="input nobottomborder">
<div class="inputtext">
Password:
</div>
<div class="inputcontent">
<input type="password" id="password" /><br />
</div>
</div>
<div class="buttons">
<input class="orangebutton" type="submit" value="Continue" onclick="if (document.getElementById('password').value == 'hello') location.href='members.html'; else alert('Wrong Password!');" />
</div>
</form>