3つのボタンがあるとします:購入オプション1、購入オプション2、&購入オプション3.それぞれのボタンは、 「受け入れる」ボタン。JavascriptまたはjQueryを使用して以前にクリックされたボタンに応じて特定のURLに移動します
ユーザーが選択するオプションに応じて、「承諾」をクリックすると別のURLに誘導したいと考えています。例えば
彼らは "購入オプション1"、その後、彼らはなどなどwww.purchaseoption1.comに行きます "受け入れる" をクリックをクリックすると...
HTMLボタン:
<button type="button" id="option1" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#disclosureModal">
Purchase option 1
</button>
<button type="button" id="option2" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#disclosureModal">
Purchase option 2
</button>
<button type="button" id="option3" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#disclosureModal">
Purchase option 3
</button>
開示モーダル:私の思考は、ボタンのIDをつかんされ
<!-- Modal -->
<div class="modal fade" id="#disclosureModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Disclosure</h4>
</div>
<div class="modal-body">
Disclosure Content
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Decline</button>
<button type="button" class="btn btn-primary">Accept</button>
</div>
</div>
</div>
</div>
変数としてそれを保存、クリックした後、使用している場合/他の直接ユーザーにif文。今私はそれをコードに入れる助けが必要です。