我输入选择如下:
<div class="mb-4 pb-2">
<select class="form-select" id="shipment-price" required
@if(Cart::content()->isEmpty()) disabled @endif>
<option value="" disabled selected style="display: none;">- Select Delivery Service -</option>
@forelse ($shipment as $shipping)
<option value="{{ $shipping->id }}">{{ $shipping->name }} ({{ presentPrice($shipping->price) }})</option>
@empty
<option value="0">-</option>
@endforelse
</select>
</div>
和div像这样
<div class="row justify-content-between">
<div class="col">
<p class="mb-1"><b>Shipping</b></p>
</div>
<div class="flex-sm-col col-auto">
<p class="mb-1"><b id="shipping-value">Rp. 0</b></p>
</div>
</div>
我想更新div价格以使用用户选择的装运服务
反相0
当使用者选择托运服务时,有人可以帮助我吗??
1条答案
按热度按时间6bc51xsx1#
onChange
的shipment-price
,您将有一个路由返回shipment value
。您的路线将如下所示:
而
YourController
中的getShipmentPrice
函数看起来像: