Skip to content

Commit

Permalink
filter kursus harga minimal dan maksimal tidak bisa minus
Browse files Browse the repository at this point in the history
  • Loading branch information
jovitamaharani committed Nov 20, 2024
1 parent 116d350 commit 9c0c17b
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions resources/views/user/pages/courses/widgets/index/filter.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
<div class="courses-cat-list">
<div class="input-group">
<span class="input-group-text">Rp</span>
<input type="number" id="minimum" class="form-control" min="0"
<input type="number" id="minimum" min="0" class="form-control" min="0"
placeholder="Harga Minimum">
</div>
<div class="input-group my-4">
<span class="input-group-text">Rp</span>
<input type="number" id="maksimum" class="form-control" min="0"
<input type="number" id="maksimum" min="0" class="form-control" min="0"
placeholder="Harga Maksimum">
</div>
<button id="filter_price" class="btn"
Expand Down Expand Up @@ -148,3 +148,17 @@
color: #6D6C80;
}
</style>

<script>
document.getElementById('minimum').addEventListener('input', function (e) {
if (this.value < 0) {
this.value = 0;
}
});
document.getElementById('maksimum').addEventListener('input', function (e) {
if (this.value < 0) {
this.value = 0;
}
});
</script>

0 comments on commit 9c0c17b

Please sign in to comment.