added form others
This commit is contained in:
@@ -43,10 +43,6 @@
|
||||
<label class="form-label">Hotel</label>
|
||||
<input type="text" class="form-control" name="hotel" id="hotel" required value="{{ old('hotel') }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Total</label>
|
||||
<input type="text" class="form-control" name="total" id="total" required value="{{ old('total') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
@@ -97,28 +93,4 @@
|
||||
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
const allowance = document.getElementById('allowance');
|
||||
const transportAnkot = document.getElementById('transport_ankot');
|
||||
const hotel = document.getElementById('hotel');
|
||||
const total = document.getElementById('total');
|
||||
|
||||
// Function to calculate total
|
||||
function calculateTotal() {
|
||||
const allowanceValue = parseInt(allowance.value) || 0;
|
||||
const transportAnkotValue = parseInt(transportAnkot.value) || 0;
|
||||
const hotelValue = parseInt(hotel.value) || 0;
|
||||
|
||||
total.value = allowanceValue + transportAnkotValue + hotelValue;
|
||||
}
|
||||
|
||||
// Attach event listeners
|
||||
[allowance, transportAnkot, hotel].forEach(input => {
|
||||
input.addEventListener('input', calculateTotal);
|
||||
});
|
||||
|
||||
// Initial calculation on page load
|
||||
calculateTotal();
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -44,10 +44,6 @@
|
||||
<label class="form-label">Hotel</label>
|
||||
<input type="text" class="form-control" name="hotel" id="hotel" required value="{{ $form->hotel }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Total</label>
|
||||
<input type="text" class="form-control" name="total" id="total" required value="{{ $form->total }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
@@ -98,28 +94,4 @@
|
||||
unformatOnSubmit: true // Nilai asli tanpa format saat dikirimkan
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
const allowance = document.getElementById('allowance');
|
||||
const transportAnkot = document.getElementById('transport_ankot');
|
||||
const hotel = document.getElementById('hotel');
|
||||
const total = document.getElementById('total');
|
||||
|
||||
// Function to calculate total
|
||||
function calculateTotal() {
|
||||
const allowanceValue = parseInt(allowance.value) || 0;
|
||||
const transportAnkotValue = parseInt(transportAnkot.value) || 0;
|
||||
const hotelValue = parseInt(hotel.value) || 0;
|
||||
|
||||
total.value = allowanceValue + transportAnkotValue + hotelValue;
|
||||
}
|
||||
|
||||
// Attach event listeners
|
||||
[allowance, transportAnkot, hotel].forEach(input => {
|
||||
input.addEventListener('input', calculateTotal);
|
||||
});
|
||||
|
||||
// Initial calculation on page load
|
||||
calculateTotal();
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user