splitforms.com

HTML · FORM CONTROL

HTML Fieldset — group related form controls (live demo)

Last reviewed

A <fieldset> groups related form controls together, and a <legend> inside it provides a caption for the group. It's the accessible way to label a set of radio buttons or checkboxes, and disabling a fieldset disables every control inside it at once.

  • 500 free total
  • No backend
  • Copy-paste ready
Live demo · nothing is sent

What gets submitted

Fill in the form above and press its button. The demo stops the request and lists every name=value pair the browser would send, plus the controls it leaves out.

With a free access key in the form, these fields land in your splitforms dashboard; access_key and botcheck are read by splitforms, not stored as lead data.

Copy-paste code

HTML Fieldset & Legend code you can paste today.

Replace YOUR_ACCESS_KEY with a key from your free splitforms dashboard. The form posts to one endpoint — submissions land in your inbox and dashboard with spam filtering built in.

Get free access key
fieldset.html
<form action="https://splitforms.com/api/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">

  <label for="name">Name</label>
  <input type="text" id="name" name="name" required>

  <fieldset>
    <legend>How should we contact you?</legend>
    <label><input type="radio" name="contact" value="email" checked> Email</label>
    <label><input type="radio" name="contact" value="phone"> Phone</label>
    <label><input type="radio" name="contact" value="sms"> SMS</label>
  </fieldset>

  <input type="checkbox" name="botcheck" style="display:none">
  <button type="submit">Send</button>
</form>

Attributes · <fieldset>

Which HTML Fieldset & Legend attributes matter?

These attributes decide how the <fieldset> behaves and what actually gets emailed to your inbox when someone submits.

HTML Fieldset & Legend attributes and what each one does
AttributeWhat it does
disabledBoolean. Disables every control inside the fieldset in one go (they're greyed out and not submitted).
formThe id of a <form> elsewhere on the page this fieldset belongs to.
nameA name for the group, used when scripting the form.
<legend>The first child of a fieldset provides its accessible caption — required for grouping radios/checkboxes.

Common mistakes

HTML Fieldset & Legend not working? Here's why.

Most broken forms come down to a few small mistakes with the <fieldset>. Check these before you ship, then forward every submission to Slack or a webhook.

  1. Legend must be first

    Only the first <legend> becomes the fieldset's accessible name, and it should be the first child. Extra legends are rendered but ignored by assistive tech.

  2. Use it to group choice groups

    A fieldset + legend is the correct, accessible way to caption a set of radio buttons or checkboxes — better than a plain heading.

  3. disabled cascades

    Setting disabled on the fieldset disables all nested controls. Useful for "same as billing" toggles, but remember none of those values are submitted.

Sources: WHATWG HTML Standard: <fieldset> · MDN: <fieldset>

Copy-paste ready

The HTML Fieldset & Legend example below is a complete, working form — paste it into any HTML page and it submits, no edits to the markup required.

No backend to build

Your html fieldset & legend form posts to one endpoint. No server, PHP, or API route — accepted submissions are saved to your dashboard before owner notification email is attempted; delivery time and inbox placement depend on provider and recipient settings.

A form that really submits

Unlike a static reference snippet, this <fieldset> form actually sends data to a free splitforms backend, with spam filtering built in.

How it works

How to add HTML Fieldset & Legend to any page.

Copy the html fieldset & legend example, drop in your free access key, and paste it into any page — submissions start landing in your dashboard.

Copy the code

Copy the HTML Fieldset & Legend example below.

Add your access key

Replace YOUR_ACCESS_KEY with a free splitforms key from the dashboard.

Paste into your site

Drop the form into any HTML page. Submissions arrive in your dashboard.

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

HTML Fieldset & Legend questions, answered.

View all FAQs
What is a fieldset in HTML?

A <fieldset> is an element that groups related form controls together. Paired with a <legend>, it gives the group an accessible caption — the standard way to label a set of radio buttons or checkboxes.

What does fieldset do?

It visually and semantically groups controls, lets you disable the whole group at once with the disabled attribute, and — with a <legend> — provides a screen-reader caption for grouped choices.

What is the legend tag used for?

<legend> is placed as the first child of a <fieldset> and acts as the caption for the group. For radio buttons like a choice of plan, the legend is what screen readers announce as the question.

How do I disable a group of inputs at once?

Wrap them in a <fieldset> and add the disabled attribute: <fieldset disabled>. Every control inside is disabled and excluded from the submission, without disabling them one by one.

Is fieldset required for radio buttons?

Not strictly required, but strongly recommended. A fieldset + legend is the accessible way to give a radio group its question label, so screen-reader users understand what they're choosing.

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