Checkboxes on pardot custom form handler aren’t saving. Are you using php? Did you forget the []?

So you’ve built a spiffy custom form and are trying to make use of the really cool feature of pardot where checkbox values can cause a prospect to be added to newsletters without using precious automations only its not saving your data OR its only saving one entry.

I am writing this post because when searching for this answer I litterally found nothing about this specific gotcha when using pardot with a php client.

Lets start by establishing a new custom prospect field (Admin -> Configure Fields -> Prospect Fields)

When creating your multi-select or checkbox HTML, you’ll need the “value” info each label. In this example; that’s “social-studies-newsletter-dynamic” and “leadership-newsletter”
These will be the values of your multi-select options or checkboxes.

So lets build a custom form handler to make use of our new custom prospect field.
(Marketing -> Forms -> Custom Form Handlers)

Lets click the edit button on that newsletters field.

That external field name… that is exactly what should appear in your custom HTML form. Exactly.

        <form action="https://pardot.example.test/l/999999/2022-02-04/99wtfm" method="post">
                <input name="email" type="text" value=""/>
                <input name="newsletters[]" type="checkbox" value="social-studies-newsletter-dynamic"/>
              <input name="newsletters[]" type="checkbox" value="leadership-newsletter"/>
            <input type="submit" />

The most important thing on this page is the [] at the end of the field name. This is what allows your browser to send more than one value for a given selection. If you by chance made a field of type checkbox or multiselect and didn’t NAME the form field correctly, you won’t get all the selected options.

This is absolutly bat shit crazy to expect marketing folks to pick up on this menuta of implementing a custom HTML form. It doesn’t appear to be documented anywhere in salesforces epic amount of documentation and it really pissed this person off too.
Saddly Polymath didn’t write that post on checkboxes.

To be clear, [] for arrays is a php thing.

Hopefully this solved your problem.