We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 81e6912 commit 6bdf21bCopy full SHA for 6bdf21b
js/dynamic_form.js
@@ -216,12 +216,15 @@ function initPersons(prefix, legend) {
216
const container = document.getElementById(`${prefix}_list`);
217
if (!container) return;
218
219
+ // If there are already persons, do not add new ones,
220
+ // renumber them if needed.
221
const existing = Array.from(container.querySelectorAll('.person'));
222
if (existing.length > 0) {
223
renumberPersons(prefix);
224
return;
225
}
226
227
+ // If no persons, add empty ones
228
const nbPersons = getNbPersons(prefix);
229
for (let i = 0; i < nbPersons; i++) {
230
addPerson(prefix, legend);
0 commit comments