0
Good evening guys, I’m having a hard time here and I can’t seem to fix it.
I have a checkout page where I display two means of payment, billet and card, the options for the user to select whether they prefer billet or card are two radio fields. Follows the html.
<section class="campaign-details-wrap">
<div class="container">
{!! Form::open(['id' => 'form']) !!}
<div class="form-group">
<div class="row">
<div class="col-md-6 mb-0">
<h4 class="mb-3">Pagamento</h4>
<label for="amount" class="font-weight-bold">Valor</label>
<input type="text" name="amount" class="form-control" value="" placeholder="" maxlength="12" required/>
</div>{{--#Col --}}
</div>{{--#Row --}}
</div>{{--#Form-group --}}
<hr class="mb-4">
<div class="form-group">
<div class="row">
<div class="col-md-12 mb-0 mt-0">
<input id="paymentCheck" name="paymentMethod" value="billet" type="radio" checked>
<label class="form-check-label" for="paymentCheck">Boleto</label>
</div>
</div>{{--#Row --}}
<div class="row">
<div class="col-md-12 mb-0 mt-0">
<input id="paymentCheck" name="paymentMethod" type="radio" value="card" class="name_display_wrap">
<label class="form-check-label" for="paymentCheck">Cartão</label>
</div>
</div>{{--#Row --}}
</div>{{--#Form-group --}}
{!! Form::close() !!}
<a href="" class="btn-finished">Finaliza Pagamento</a>
</div>
</section>
I need to perform some actions in jQuery, but each action of these depends on the selected payment method.
I need to select the input/radio, take the value of this radio to then execute the action, but I’m not able to get the value of input/radio if it was billet or card to perform the action, someone knows how to do it in jQuery ?
Thanks for the guidance regarding id, but I need to do an if, for example, if radio billet was selected, perform action, lse another action.
– Rafael
Okay, so that’s all you need:
if($('#paymentCheckBillet').is(':checked'))
– Ricardo Pontual
Thanks Ricardo, thank you so much was what I needed.
– Rafael