Suppose I have two radio buttons related to product pricing. I want to show the product price according to the selection of radio button. As an example if you select regular price
radio button, I want show you regular price of the product. And if you select extended price
radio button, I wanna show you extended price of the product. How can I do this in Laravel 8? Here is the related code:
<h3>${{$item_price}}</h3> // this $item_price is depends on the radio button which customer select.
<div class="custom-radio">
<input type="radio" id="opt1" class="item-price" value="100" name="item_price" checked>
<label for="opt1" data-price="100">
<span class="circle"></span> Regular Price
</label>
</div>
<div class="custom-radio">
<input type="radio" id="opt2" class="item-price" value="150" name="item_price" checked>
<label for="opt1" data-price="150">
<span class="circle"></span> Extended Price
</label>
</div>
I'm new in laravel, I try with Form::radio("item_price", "value")
, but it gives me the radio button(DOM Element) instead of the value!
Is there any easy way to get the selected/checked radio button value in laravel 8 or php 7 ?