Menambahkan fitur nama pimpinan bisa lebih dari satu

This commit is contained in:
2024-11-11 16:25:23 +07:00
parent 5b5e45baf6
commit 486f0d758b
6 changed files with 215 additions and 26 deletions

View File

@@ -41,6 +41,31 @@
addDeleteListeners();
});
const namaPimpinanDiv = document.getElementById('detail_nama_pimpinan');
document.getElementById("tambah_nama_pimpinan").addEventListener("click", function() {
const newDiv = document.createElement("div");
newDiv.className = "flex flex-col lg:flex-row gap-2 items-baseline lg:items-center w-full";
newDiv.innerHTML = `
<label class="form-label max-w-56">
Nama Pimpinan
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input" type="text" name="detail_nama_pimpinan[nama_pimpinan][]" value="">
</div>
<label class="form-label max-w-56">
Nomor HP Pimpinan
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input" type="text" name="detail_nomor_hp_pimpinan[nomor_hp_pimpinan][]" value="">
</div>
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
`;
namaPimpinanDiv.appendChild(newDiv);
addDeleteListeners();
});
const namaPicReviewerDiv = document.getElementById('detail_nama_pic_reviewer');
document.getElementById("tambah_nama_pic_reviewer").addEventListener("click", function() {