perbaikan form inspeksi bagian unit, dan kertas kerja

This commit is contained in:
majid
2024-12-14 04:23:14 +07:00
parent 3c5b372f7d
commit ab7150a97f
9 changed files with 889 additions and 612 deletions

View File

@@ -165,7 +165,6 @@
<div class="input-group w-full flex gap-2">
<input type="file"
value="{{ old('foto_denah', isset($formDenah['foto_denah']) ? $formDenah['foto_denah'] : '') }}"
name="foto_denah" class="file-input file-input-bordered w-full"
accept=".jpg,.jpeg,.png,.pdf" onchange="previewFile(this)">
</div>
@@ -186,7 +185,7 @@
<label class="form-label max-w-56">
<span class="form-label">Masukkan total luas tanah</span>
</label>
<input type="text" name="luas" class="input w-full "
<input type="text" name="luas" class="input w-full number-format"
value="{{ old('luas', isset($formDenah['luas']) ? $formDenah['luas'] : '') }}">
</div>
@@ -216,7 +215,15 @@
@push('scripts')
@include('lpj::surveyor.js.utils')
<script>
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.number-format').forEach(input => {
input.addEventListener('input', function() {
formatNumber(this);
});
});
});
function previewFile(input) {
const previewContainer = document.getElementById('preview-container');
const imagePreview = document.getElementById('foto_denah-preview');

View File

@@ -215,14 +215,12 @@
if (errors) {
$.each(errors, function(key, value) {
$(`#error-${key}`).text(value[0]);
toastrErrorBuild(value[0]);
});
// toastrErrorBuild(error);
}
hideLoadingSwal();
console.error('Terjadi error:', error); // Menampilkan pesan error di konsol
console.log('Status:', status);
console.log('Response:', xhr.responseText);
console.log(errors);
toastrErrorBuild(error);
}
});
}