consent posts as a JSON boolean (the checkbox's literal 'on' never reaches the webhook)
This commit is contained in:
1 parent
cc77b242ae
commit
43d3420f74
1 file changed
+3
@@ -123,6 +123,9 @@ const note = type === "founders" ? strings.form_founders_note : strings.form_hub
|
|||||||
const data = new FormData(form);
|
const data = new FormData(form);
|
||||||
const payload = {};
|
const payload = {};
|
||||||
data.forEach((v, k) => { payload[k] = v; });
|
data.forEach((v, k) => { payload[k] = v; });
|
||||||
|
// consent as a JSON boolean (the Flow/CRM mapping expects true/false,
|
||||||
|
// not the checkbox's literal "on"; an unchecked box never arrives)
|
||||||
|
payload.consent = data.get("consent") === "on";
|
||||||
if (payload.website) return; // honeypot: pretend success, send nothing
|
if (payload.website) return; // honeypot: pretend success, send nothing
|
||||||
if (capField && !payload.capabilities) payload.capabilities = capField.value;
|
if (capField && !payload.capabilities) payload.capabilities = capField.value;
|
||||||
button.disabled = true;
|
button.disabled = true;
|
||||||
|
|||||||
Reference in new issue
Block a user