How to Connect Eleventy (11ty) Forms to Form2Lead
Step-by-step developer instructions for Eleventy (11ty) applications.
How do you send Eleventy (11ty) form submissions to Form2Lead?
Add a serverless contact form to an Eleventy (11ty) site by pointing a Nunjucks or HTML form template at a Form2Lead endpoint.
Why use Form2Lead with Eleventy (11ty)?
Eleventy builds zero-JavaScript static output, so there is no server to receive form POSTs. Form2Lead acts as the backend: include a plain HTML form in an Eleventy template (Nunjucks, Liquid, or HTML), set the action to your Form2Lead URL, and submissions are emailed, stored, and spam-checked. Your build stays `--formats` clean and deploys to any static host.
Prerequisites
- ✔An Eleventy (11ty) project
- ✔A Form2Lead endpoint URL
Step-by-Step Integration Guide
01. Create the Form Template
Add a Nunjucks include with a plain HTML form pointed at your Form2Lead endpoint.
<form action="https://form2lead.com/api/v1/f/YOUR_FORM_ID" method="POST"> <input type="text" name="name" placeholder="Name" required /> <input type="email" name="email" placeholder="Email" required /> <textarea name="message" placeholder="Message" required></textarea> <input type="text" name="_gotcha" style="display:none !important" tabindex="-1" autocomplete="off" /> <button type="submit">Submit</button> </form>
02. Use the Include in a Page
Reference the include from any Eleventy layout or page.
---
layout: base.njk
title: Contact
---
{% include "contact-form.html" %}03. Lock Down Allowed Domains
Add your deployed origin (e.g. `eleventy-docs.netlify.app` or your domain) to Allowed Domains in Form2Lead.
Eleventy (11ty) Integration FAQ
Does Eleventy need a plugin or build hook for Form2Lead?
No. Eleventy just outputs the static HTML form — the browser posts directly to Form2Lead, so no build-time integration is needed.