perbaikan form inspeksi dan

This commit is contained in:
majid
2024-12-09 15:49:44 +07:00
parent 2d45e03095
commit 4ed2afda72
11 changed files with 559 additions and 435 deletions

View File

@@ -206,7 +206,7 @@
}).then((response) => {
if (response.isConfirmed) {
// window.location.href =
// '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
// '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
}
});
} else {
@@ -266,21 +266,39 @@
return;
}
// Clone the template element
const newElement = template.cloneNode(true);
const textarea = newElement.querySelector('textarea');
if (textarea) {
textarea.value = '';
}
// Reset input fields
const inputs = newElement.querySelectorAll('input');
inputs.forEach(input => {
input.value = '';
});
// Make the delete button visible and bind the click event
const deleteButton = newElement.querySelector('.remove-btn');
if (deleteButton) {
deleteButton.style.display = 'inline-block';
deleteButton.addEventListener('click', () => newElement.remove());
deleteButton.addEventListener('click', () => {
newElement.remove();
});
}
// Append the cloned element to the container
container.appendChild(newElement);
}
// Ensure existing remove buttons are functional
document.addEventListener('DOMContentLoaded', () => {
const removeButtons = document.querySelectorAll('.remove-btn');
removeButtons.forEach(button => {
button.addEventListener('click', function() {
this.closest('.perwakilan').remove();
});
});
});
function updateAnalisa(params) {
const inputMap = {
@@ -363,6 +381,7 @@
pointer-events: none;
}
div[disabled]:hover {
background-color: #e8e8e8;
}