Setel input harga diskon menjadi readonly
- Menambahkan atribut `readonly` pada input `harga_diskon` dan `harga_diskon_pembanding` untuk mencegah pengeditan langsung. - Menghapus pembatas nilai maksimum 100 pada event listener input diskon pembanding.
This commit is contained in:
@@ -451,11 +451,11 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="px-4 py-2">Harga Setelah Diskon</td>
|
<td class="px-4 py-2">Harga Setelah Diskon</td>
|
||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
<input type="text" name="harga_diskon" class="input currency-format"
|
<input type="text" name="harga_diskon" class="input currency-format" readonly
|
||||||
value="{{ $inspectionData['asset']['harga_diskon'] ?? '' }}">
|
value="{{ $inspectionData['asset']['harga_diskon'] ?? '' }}">
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
<input type="text" name="harga_diskon_pembanding[]"
|
<input type="text" name="harga_diskon_pembanding[]" readonly
|
||||||
class="input currency-format">
|
class="input currency-format">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -777,7 +777,6 @@
|
|||||||
if (input.name.includes('diskon_pembanding')) {
|
if (input.name.includes('diskon_pembanding')) {
|
||||||
input.addEventListener('input', function() {
|
input.addEventListener('input', function() {
|
||||||
let value = parseFloat(this.value.replace(/[^\d]/g, '') || '0');
|
let value = parseFloat(this.value.replace(/[^\d]/g, '') || '0');
|
||||||
value = Math.min(value, 100);
|
|
||||||
this.value = formatCurrency(value.toString());
|
this.value = formatCurrency(value.toString());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user