「変更」ボタンがあるウェブページがあります。そのボタンをクリックすると、モーダルが表示され、ユーザーに番号を入力するよう求められます。ユーザーが入力した番号を保存してWebページに表示できる必要があります。フォーム内にモーダルを作成しましたが、ウェブページの変更をどのように表示するのか分かりません。 は、それはこのようなものだ:モーダル:値を保存してページに表示する方法
<a class="btn btn-primary" data-toggle="modal" data-target="#moneyModal">
<span class="glyphicon glyphicon-money glyphicon-white"></span>Change</a>
<div class="modal fade" id="moneyModal" role="dialog">
<div class="modal-dialog">
<form method="post" action="change-goal">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Change Goal</h4>
</div>
<div class="modal-body">
<p>Please enter a new number.</p>
</div>
<div class="modal-body">
<input class="form-control" name="newGoal" id="newGoal">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" >Save</button>
</div>
</div>
</form>
</div>
</div>
だから、私の質問は次のようになり、どのように私は、「保存」ボタンをクリックした後、入力フィールド(ID = newGoal)に ユーザーが入力した値が表示されません。 本当に助けていただければ幸いです。
それworked.Thanks!値を保存するためには何が必要なのですか?ページを更新するときに値はまだ残っています – AJth
クッキーなどのサーバー側が必要な新しい質問を開始します。 –