[EDIT] 収支区分の値について、支出が0、収入が1になっていなかった箇所を修正しました。
This commit is contained in:
@@ -40,8 +40,8 @@
|
||||
<select class="form-select" id="transactionType">
|
||||
|
||||
<option value="">選択してください</option>
|
||||
<option value="1">支出</option>
|
||||
<option value="2">収入</option>
|
||||
<option value="0">支出</option>
|
||||
<option value="1">収入</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
@@ -70,7 +70,7 @@
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="amount">金額</label>
|
||||
|
||||
<input class="form-control" type="number" id="amount" th:field="*{amount}" min="0" placeholder="金額を入力してください"
|
||||
<input class="form-control" type="number" id="amount" th:field="*{amount}" min="1" placeholder="金額を入力してください"
|
||||
required>
|
||||
</div>
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
transactionType.addEventListener("change", function () {
|
||||
|
||||
if (this.value === "1") {
|
||||
if (this.value === "0") {
|
||||
|
||||
for (let i = 0; i < expenseList.length; i++) {
|
||||
expenseList[i].style.display = "";
|
||||
@@ -104,7 +104,7 @@
|
||||
incomeList[i].style.display = "none";
|
||||
}
|
||||
|
||||
} else if (this.value === "2") {
|
||||
} else if (this.value === "1") {
|
||||
|
||||
for (let i = 0; i < expenseList.length; i++) {
|
||||
expenseList[i].style.display = "none";
|
||||
|
||||
@@ -45,11 +45,11 @@
|
||||
選択してください
|
||||
</option>
|
||||
|
||||
<option value="1">
|
||||
<option value="0">
|
||||
支出
|
||||
</option>
|
||||
|
||||
<option value="2">
|
||||
<option value="1">
|
||||
収入
|
||||
</option>
|
||||
|
||||
@@ -124,15 +124,15 @@
|
||||
const tType = '[[${session.tType}]]';
|
||||
|
||||
if (tType == "0") {
|
||||
transactionType.value = 1;
|
||||
transactionType.value = 0;
|
||||
} else {
|
||||
transactionType.value = 2;
|
||||
transactionType.value = 1;
|
||||
}
|
||||
|
||||
|
||||
transactionType.addEventListener("change", function () {
|
||||
|
||||
if (this.value === "1") {
|
||||
if (this.value === "0") {
|
||||
|
||||
for (let i = 0; i < expenseList.length; i++) {
|
||||
expenseList[i].style.display = "";
|
||||
@@ -142,7 +142,7 @@
|
||||
incomeList[i].style.display = "none";
|
||||
}
|
||||
|
||||
} else if (this.value === "2") {
|
||||
} else if (this.value === "1") {
|
||||
|
||||
for (let i = 0; i < expenseList.length; i++) {
|
||||
expenseList[i].style.display = "none";
|
||||
|
||||
Reference in New Issue
Block a user