diff --git a/services/web/frontend/js/features/form-helpers/hydrate-form.js b/services/web/frontend/js/features/form-helpers/hydrate-form.js index 2eb6907e3b..555e156f77 100644 --- a/services/web/frontend/js/features/form-helpers/hydrate-form.js +++ b/services/web/frontend/js/features/form-helpers/hydrate-form.js @@ -109,7 +109,13 @@ async function sendFormRequest(formEl, captchaResponse) { if (captchaResponse) { formData.set('g-recaptcha-response', captchaResponse) } - const body = Object.fromEntries(formData.entries()) + const body = Object.fromEntries( + Array.from(formData.keys(), key => { + // forms may have multiple keys with the same name, eg: checkboxes + const val = formData.getAll(key) + return [key, val.length > 1 ? val : val.pop()] + }) + ) const url = formEl.getAttribute('action') return postJSON(url, { body }) }