Skip to content

Commit 842cf48

Browse files
authored
Ensure that input IDs are unique on the checkout page (#643)
Without this change, clicking an input field in the "Kiadás hozzáadása" section would trigger the respective field in the "Bevétel hozzáadása" section, as the IDs of the input fields were the same. This commit adds prefixes to the IDs to indicate which form they belong to, while keeping the old "name" attributes to avoid having to change the backend code.
1 parent a7169ed commit 842cf48

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

resources/views/utils/checkout/add-expense.blade.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
<form method="POST" action="{{ route($route_base . '.expense.add') }}" enctype="multipart/form-data">
2828
@csrf
2929
<div class="row">
30-
<x-input.text m=6 l=6 id="comment" required text="Megjegyzés" />
31-
<x-input.text type="number" m=6 l=6 id="amount" min=0 required text="Összeg" />
30+
<x-input.text m=6 l=6 id="expense-comment" name="comment" required text="Megjegyzés" />
31+
<x-input.text type="number" m=6 l=6 id="expense-amount" name="amount" min=0 required text="Összeg" />
3232
@can('administrate', $checkout)
33-
<x-input.select m=6 l=6 id="payer" text="Fizető" :elements="\App\Models\User::collegists()" default="{{user()->id}}" :formatter="function($user) { return $user->uniqueName; }" />
34-
<x-input.checkbox m=6 l=6 id="paid" checked text="A tartozás kifizetésre került"/>
33+
<x-input.select m=6 l=6 id="expense-payer" name="payer" text="Fizető" :elements="\App\Models\User::collegists()" default="{{user()->id}}" :formatter="function($user) { return $user->uniqueName; }" />
34+
<x-input.checkbox m=6 l=6 id="expense-paid" name="paid" checked text="A tartozás kifizetésre került"/>
3535
@endcan
36-
<x-input.file s="12" id="receipt" style="margin-top:auto" accept=".pdf,.jpg,.png,.jpeg,.gif"
36+
<x-input.file s="12" id="expense-receipt" name="receipt" style="margin-top:auto" accept=".pdf,.jpg,.png,.jpeg,.gif"
3737
text="checkout.receipt" required/>
3838
</div>
3939
<x-input.button floating class="btn-large right" icon="payments" />

resources/views/utils/checkout/add-income.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<form method="POST" action="{{ route($route_base . '.income.add') }}">
99
@csrf
1010
<div class="row">
11-
<x-input.text m=6 l=6 id="comment" required text="Megjegyzés" />
12-
<x-input.text type="number" m=6 l=6 id="amount" min=0 required text="Összeg" />
11+
<x-input.text m=6 l=6 id="income-comment" name="comment" required text="Megjegyzés" />
12+
<x-input.text type="number" m=6 l=6 id="income-amount" name="amount" min=0 required text="Összeg" />
1313
</div>
1414
<x-input.button floating class="btn-large right" icon="payments" />
1515
</form>

0 commit comments

Comments
 (0)