mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-07 16:19:02 +02:00
Change sales form 'Interested in' to be multi-select checkboxes (#8872)
* Change form helper serialization to allow for multi-values * Change sales form 'Interested in' to be multi-select checkboxes * Add clarification text to server pro/commons products GitOrigin-RevId: 2732a8975ea36602375949a23b19705e4d4c9080
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user