私はthymeleaf、html、angularjs、js、およびspringブートを使用してWebアプリケーションを作成しています。私の主な質問は、入力値を保持して、その値を次のページの入力ボックスに表示させる方法です。htmlでリダイレクトされた後の入力値の保持方法
例:右上の検索バーに質問を入力するとスタックオーバーフローが発生し、リダイレクトされ、以前に入力した値と同じ値を持つ新しい検索バーが表示されます。
Index.htmlと
<form action="getDetails" method="POST">
<p> Mac Address: </p><input type="text" name="inputMacAddress" id="inputMacAddress" required="required" placeholder="Enter Mac Address" />
<br/>
<input type="submit" value="Submit" class="marginButton"/> <input type="reset" value="Clear" onclick="Redirect();" class="marginButton" />
<script>
function Redirect()
{
window.location.href = 'http://www.localhost:8080';
}
</script>
</form>
getDetails.html
<form action="getDetails" method="POST">
<p> Mac Address: </p><input type="text" name="inputMacAddress" id="inputMacAddress" required="required" placeholder="Enter Mac Address" />
<br/>
<input type="submit" value="Submit"/> <input type="reset" value="Clear" onclick="Redirect();" />
<script>
function Redirect()
{
window.location.href = 'http://www.localhost:8080';
}
</script>
</form>
を見てみましょうか? – AymDev
URLクエリパラメータを確認してください –
@AymDev PHPを使用したくありません。 –