私の MVC プロジェクトでは、顧客がアカウントを作成すると、請求先住所と配送先住所の入力が求められます。
同じ住所を 2 回入力するのではなく、同じ請求先住所の詳細で配送先住所を更新する、請求先住所の下のチェック ボックスが必要です。
方法がわからないので、助けていただければ幸いです)チェックボックスの例は次のとおりです
<div class="checkbox">@Html.CheckBoxFor(m => signup.SameAddress)</div>
<div class="label">@Html.LabelFor(m => signup.SameAddress, T(Use same address as billing"))</div>
これまでのところ、私のコードは次のようになっています(以下)。ATM では、同じ詳細を 2 回入力する必要があります。
<article class="addresses form">
<fieldset>
<div class="span5">
<h2>@T("Invoice Address")</h2>
<table class="table-bordered table-striped table">
<colgroup>
<col id="Col1" />
<col id="Col2" />
</colgroup>
<thead>
<tr>
<th scope="col">@T("Name")</th>
<td>@invoiceAddress.Name.Value</td>
</tr>
<tr>
<th scope="col">@T("AddressLine1")</th>
<td>@invoiceAddress.AddressLine1.Value<</td>
</tr>
</thead>
</table>
</div>
//insert checkbox here
<div class="span5">
<h2>@T("Billing Address")</h2>
<table class="table-bordered table-striped table">
<colgroup>
<col id="Col1" />
<col id="Col2" />
</colgroup>
<thead>
<tr>
<th scope="col">@T("Name")</th>
<td>@shippingAddress.Name.Value</td>
</tr>
<tr>
<th scope="col">@T("AddressLine1")</th>
<td>@shippingAddress.AddressLine1.Value<</td>
</tr>
</thead>
</table>
</div>
</fieldset>
</article>
JQuery または JS を使用して、配送先住所を請求書に指定された住所と同じ住所に自動的に更新したいと考えています。
返信ありがとうございます...