splitforms.com

Contact form · Bootstrap

Contact form for Bootstrap sites

Bootstrap 5's form components handle the UI; splitforms handles the backend. Use .form-control + .was-validated for native validation, POST to splitforms, and ship a working contact form in minutes.

  • 500 free total
  • One endpoint
  • No backend code
Bootstrap contact form — copy-paste code for splitforms

No backend code

No server, API route, or SDK. Your Bootstrap form posts straight to one endpoint.

Straight to your inbox

Every submission is emailed to you and saved to a searchable dashboard — spam filtered before it reaches you.

Design without limits

It's your own Bootstrap markup and styles. Splitforms is only the backend, so nothing constrains how the form looks.

Copy-paste ready

Your Bootstrap contact form, ready to paste.

Replace YOUR_ACCESS_KEY with the key from your dashboard — that's the whole integration. No SDK to install, no build step, just the html you already write.

Generate access key
contact.html
<form id="contact" class="row g-3 needs-validation" novalidate>
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY" />

  <div class="col-12">
    <label for="name" class="form-label">Name</label>
    <input id="name" name="name" type="text" class="form-control" required />
    <div class="invalid-feedback">Please enter your name.</div>
  </div>

  <div class="col-12">
    <label for="email" class="form-label">Email</label>
    <input id="email" name="email" type="email" class="form-control" required />
    <div class="invalid-feedback">Please enter a valid email.</div>
  </div>

  <div class="col-12">
    <label for="topic" class="form-label">Topic</label>
    <select id="topic" name="topic" class="form-select" required>
      <option value="" selected disabled>Choose a topic…</option>
      <option value="sales">Sales</option>
      <option value="support">Support</option>
      <option value="other">Other</option>
    </select>
    <div class="invalid-feedback">Please pick a topic.</div>
  </div>

  <div class="col-12">
    <label for="message" class="form-label">Message</label>
    <textarea id="message" name="message" rows="4" class="form-control" required></textarea>
    <div class="invalid-feedback">Don't forget the message.</div>
  </div>

  <!-- Honeypot — invisible to humans -->
  <input type="checkbox" name="botcheck" class="d-none" tabindex="-1" />

  <div class="col-12">
    <button type="submit" class="btn btn-primary">Send message</button>
    <span id="status" class="ms-2 text-muted small"></span>
  </div>
</form>

<script>
  (() => {
    const form   = document.getElementById("contact");
    const status = document.getElementById("status");

    form.addEventListener("submit", async (e) => {
      e.preventDefault();
      form.classList.remove("was-validated");
      if (!form.checkValidity()) { form.classList.add("was-validated"); return; }

      const btn = form.querySelector('button[type="submit"]');
      btn.disabled = true;
      status.textContent = "Sending…";

      try {
        const res  = await fetch("https://splitforms.com/api/submit", {
          method: "POST",
          body: new FormData(form),
        });
        const data = await res.json();
        if (data.success) {
          status.textContent = "Thanks — we'll be in touch.";
          form.reset();
        } else {
          // Server-side error → flag the offending field Bootstrap-style.
          // Add .is-invalid to the input and its sibling .invalid-feedback shows.
          status.textContent = data.message || "Something went wrong.";
        }
      } catch {
        status.textContent = "Network error — please try again.";
      } finally {
        btn.disabled = false;
      }
    });
  })();
</script>

How to add it

How to add a contact form to a Bootstrap website.

To add a contact form to a Bootstrap website you need three things: a free splitforms access key, the html snippet above, and your key pasted into it. No backend, server, or SDK — the form posts to one URL and every submission lands in your inbox and dashboard.

Get your free splitforms access key

Sign up at splitforms.com, verify your email, and copy your access key from the dashboard. No credit card required.

Drop the Bootstrap snippet into your project

Copy the Bootstrap code example into your project and replace YOUR_ACCESS_KEY with the key from step 1.

Receive submissions in your dashboard

Submissions arrive in the splitforms dashboard within seconds. Free includes owner email notification attempts; Pro adds Slack, Discord, Sheets, or any signed webhook URL.

Where submissions go

Where do your Bootstrap form submissions go?

Every submission is emailed to you and saved to a searchable dashboard — spam filtered before it ever reaches you. Search, export to CSV, or forward it to a webhook or Slack on Pro.

  • 500 submissions total, free to start
  • Honeypot + automatic spam scoring on every plan
  • Signed webhooks to Slack, Discord, your server
Bootstrap contact form submissions in the splitforms dashboard

No backend needed

Do you need a backend for a Bootstrap form? No.

Your Bootstrap form posts standard FormData to one URL. Splitforms validates the access key, runs its spam checks, and forwards it to your email — so there's no server, API route, or database for you to build or maintain.

  • Native Bootstrap 5 validation classes — .form-control, .form-label, .form-select, .invalid-feedback
  • Works with every Bootstrap theme (Bootswatch, MDB, Tabler, Tailwind+Bootstrap)
  • Smart spam filtering on the splitforms side — drop reCAPTCHA, keep conversion
How splitforms processes a Bootstrap form submission

Best practices

What a production-ready Bootstrap form needs.

The difference between a form that works in the demo and one that survives launch traffic — the production-tested defaults, in priority order.

  • Use the .needs-validation + novalidate + .was-validated trio verbatim — it's Bootstrap's official validation contract. Don't reinvent validation UI on top of it.
  • Wrap each field in a .mb-3 (or .col-12 inside a .row.g-3 grid) with the .form-label, the input, and a .invalid-feedback div as siblings — Bootstrap's CSS selectors expect that structure.
  • Use .form-select for dropdowns, not <select class="form-control">. Bootstrap 5 split selects from text inputs; styling a <select> with .form-control under-renders in 5.x.
Production-ready Bootstrap contact form best practices

How SplitForms works

What happens after someone submits your form?

splitforms receives the submission, filters spam, saves it to your dashboard and emails you — then, on paid plans, sends it on to your webhooks and integrations. No backend infrastructure to build.

A SplitForms contact form submission launching straight to your inbox

Add your endpoint

Point your form to your unique SplitForms endpoint. That's it.

HTML form pointing at a SplitForms submit endpoint

Receive submissions

We instantly capture and organize every submission in your inbox.

Submissions inbox with searchable leads and status pills

Route anywhere

Send data to email, spreadsheets, CRMs, webhooks, and 7,000+ apps.

Generic integration tiles for email, sheets, chat, CRM, automate, and webhook

No credit card required. Set up in under 60 seconds.

Connect & automate

Where can submissions go besides email?

On paid plans, submissions can also go to Slack, Discord, Google Sheets, Notion, Airtable, Zapier or any signed webhook — and splitforms works on the platforms you build on, from WordPress and Shopify to Next.js. With Stripe connected, your forms can take payments too.

Connect your SplitForms form to Slack, Google Sheets, Mailchimp, Zapier and more
NewTake payments on your formsDeposits, bookings, order forms — submitters check out through Stripe and the money goes straight to your Stripe account. Included on every paid plan.See plans →

Setup guides for the stacks you use

Questions

Bootstrap contact form questions.

View all FAQs
How do I add a Bootstrap contact form?

Copy the snippet above, include Bootstrap 5's CSS (bootstrap.min.css) on the page, and replace YOUR_ACCESS_KEY with your splitforms key. The form validates client-side via .needs-validation, then POSTs to splitforms through fetch and shows the result inline in the #status span.

Does splitforms need Bootstrap's JavaScript bundle?

No. The contact-form snippet uses plain fetch plus Bootstrap's CSS validation classes. The Bootstrap JS bundle is only needed if the same page also uses dropdowns, modals, or offcanvas. You can ship the form with just the stylesheet.

How do I show server-side per-field errors with .is-invalid?

When splitforms returns { success: false, message }, add the .is-invalid class to the relevant input (emailField.classList.add('is-invalid')) and write the error text into its sibling .invalid-feedback div. Bootstrap's CSS reveals .invalid-feedback automatically whenever the preceding control has .is-invalid. Clear the class before the next submit.

Bootstrap 4 vs Bootstrap 5 — does it matter for splitforms?

No — the POST is identical. Bootstrap 5 renamed .form-group to .mb-3, split selects out into .form-select, and dropped the jQuery dependency. If you're on Bootstrap 4, swap .form-select for <select class="form-control"> and keep the rest of the snippet as-is.

How do I handle form errors in Bootstrap?

Two layers. Client-side: the .needs-validation + .was-validated pattern handles required/format errors with no JavaScript beyond the one-line checkValidity switch. Server-side: read data.message from the splitforms response and either render it in a #status element or flag the offending field with .is-invalid so its .invalid-feedback shows.

Can I use this with Bootstrap-flavored frameworks (MDB, Bootswatch, Tabler)?

Yes — they all extend Bootstrap's class system, so .form-control, .form-label, .form-select, and .invalid-feedback all work unchanged. MDB ships its own .validate() JS; if you enable it, let MDB drive client validation and keep the fetch handler only for delivery.

needs-validation + novalidate is a pair — drop either and validation double-fires or never fires

Bootstrap's client-side validation contract is two attributes working together: <form class="needs-validation" novalidate>, plus a submit handler that adds .was-validated. The novalidate attribute turns off the browser's native bubbles so Bootstrap's .invalid-feedback styling is the only UI; .needs-validation is the selector your JS targets. Forget novalidate and you get two sets of error UI (native + Bootstrap) fighting each other. Drop .needs-validation and your querySelectorAll('.needs-validation') finds nothing, so no fields ever get validated. Copy the pair verbatim.

.invalid-feedback stays display:none without .was-validated on the form or .is-invalid on the field

Bootstrap's CSS is .was-validated .invalid-feedback { display: block } and .is-invalid ~ .invalid-feedback { display: block }. Render .invalid-feedback divs but never add .was-validated to the form (or .is-invalid to the specific input) and the feedback stays invisible — users click Send and nothing appears. For client-side errors use the .was-validated form-level switch (the snippet above); for server-side per-field errors from splitforms (e.g. a rejected email), target the specific input: emailInput.classList.add('is-invalid') and write the message into its sibling .invalid-feedback.

Bootstrap 5 dropped jQuery — but many themes still bundle it and double-bind submit

Bootstrap 5's dropdowns, modals, and offcanvas are vanilla JS, but plenty of themes (AdminLTE derivatives, older SB Admin, bootswatch+jQuery combos) still ship jQuery and call $(form).submit(...). If the theme's jQuery handler and your fetch handler both bind to the same form, the form can POST twice — or the theme handler calls e.preventDefault() and silently cancels yours. Open DevTools → Event Listeners on the <form>, confirm only your handler is bound, and strip legacy attributes like data-toggle="validator" and data-toggle="form-validator" that re-attach third-party validators.

Simple pricing

How much does splitforms cost?

Free gives you 500 submissions for $0 — no card, no time limit. Pro is $5/month for 5,000 submissions a month, and Annual is $49/year for 15,000 a month with every Pro feature.

Free

$0— 500 submissions
 

No card, no time limit

Best for testing

For side projects and indie devs.

  • 500 free submissions
  • Unlimited forms
  • Email notifications included
  • Smart spam filtering
  • Submissions dashboard
  • Redirect after submit
  • MCP server included

Annual

$49/ year
About $4.08/mo, billed yearly
Best value

Every Pro feature with triple the volume — $0.27 per 1,000 at full use.

  • 15,000 submissions / mo
  • Unlimited forms
  • Everything in Pro
  • File uploads with 5 GB storage
  • 3 team seats
  • Priority email support

No credit card required on Free • Cancel anytime • Full pricing and FAQ