私は現在、ユーザーがボタンをクリックして条件に同意するだけで通過できるようにする作業コードを持っています。パスワードが正しい場合にのみ誰かを許可するパスワードフィールドと同意ボタンを統合したいと思います。
シンプルなボタンを使用した現在の作業コードは次のとおりです。
Agree to Connect:
<br>
<br>
<form method="post" id="login" action="http://10.0.0.1:5280/">
<input type="hidden" name="accept_terms" value="yes">
<input type="hidden" name="redirect" value="http://www.anderson1216.com/wifi-success.html">
<input type="hidden" name="mode_login">
<input type="submit" value="Accept Terms of Use and Connect">
</form>
<br>
//agreement text here
<br>
<br>
We thank you for your understanding and cooperation.
<br>
<br>
<form method="post" id="login" action="http://10.0.0.1:5280/">
<input type="hidden" name="accept_terms" value="yes">
<input type="hidden" name="redirect" value="http://www.anderson1216.com/wifi-success.html">
<input type="hidden" name="mode_login">
<input type="submit" value="Accept Terms of Use and Connect">
</form>
これは、私が見つけた簡単なパスワード フォームです。
<head>
<script type="text/javascript">
function isValid(){
var password = document.getElementById('password').value;
if (password == "password123")
{alert('Correct!')
else
{alert('Wrong Password')}
}
</script>
</head>
<form name="PasswordField" action="">
Password:
<input type="password" id="password" name="password">
<input type="button" value="Log in" onclick="isValid();">
</form>
コードが機能するためには、コードの最初のブロックの最初のステートメントをどこかに含めて、その人が受け入れたことをルーターに伝え、ボタンをクリックした後に別の Web サイトにリダイレクトする必要があります。正しいパスワードには警告は必要ありません。間違ったパスワードだけです。助言がありますか?