mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05: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:
parent
8841c8c874
commit
79cdf5e65e
1 changed files with 7 additions and 1 deletions
|
@ -109,7 +109,13 @@ async function sendFormRequest(formEl, captchaResponse) {
|
||||||
if (captchaResponse) {
|
if (captchaResponse) {
|
||||||
formData.set('g-recaptcha-response', 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')
|
const url = formEl.getAttribute('action')
|
||||||
return postJSON(url, { body })
|
return postJSON(url, { body })
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue