fix: 🐛 Disabled submit button when no method choosen
This commit is contained in:
parent
41f8fd9550
commit
30f70b35a2
|
@ -28,7 +28,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|
||||||
<form action="{{ route('payment.pay') }}" method="POST">
|
<form x-data="{ payment_method: '', clicked: false }" action="{{ route('payment.pay') }}" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
@method('post')
|
@method('post')
|
||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
|
@ -84,9 +84,9 @@
|
||||||
<div class="ml-2">
|
<div class="ml-2">
|
||||||
<label class="text-center" for="{{ $gateway->name }}">
|
<label class="text-center" for="{{ $gateway->name }}">
|
||||||
<img class="mb-3" height="50" src="{{ $gateway->image }}"></br>
|
<img class="mb-3" height="50" src="{{ $gateway->image }}"></br>
|
||||||
<input x-model="payment_method" type="radio"
|
<input x-on:click="console.log(payment_method)" x-model="payment_method"
|
||||||
id="{{ $gateway->name }}" value="{{ $gateway->name }}"
|
type="radio" id="{{ $gateway->name }}"
|
||||||
name="payment_method">
|
value="{{ $gateway->name }}">
|
||||||
</input>
|
</input>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -129,9 +129,10 @@
|
||||||
<!-- this row will not appear when printing -->
|
<!-- this row will not appear when printing -->
|
||||||
<div class="row no-print">
|
<div class="row no-print">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<button x-on="console.log('Method', paymentMethod)" :disabled="!paymentMethod"
|
<button :disabled="!payment_method || clicked"
|
||||||
:class="!paymentMethod ? 'disabled' : ''" class="btn btn-success float-right"><i
|
:class="!payment_method || clicked ? 'disabled' : ''"
|
||||||
class="far fa-credit-card mr-2"></i>
|
class="btn btn-success float-right"><i class="far fa-credit-card mr-2"
|
||||||
|
@click="clicked = true"></i>
|
||||||
{{ __('Submit Payment') }}
|
{{ __('Submit Payment') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue