splitforms.com

HTML · INPUT TYPE

HTML input type=color: color picker and the hex value it sends

Last reviewed

An <input type="color"> shows the operating system's color picker. Its value is always a lowercase 7-character hex string like #ff6600, with no alpha. An empty or invalid value becomes #000000, so the field always submits something and required has no effect.

  • Live, editable example
  • Copy-paste snippet
  • Attributes & common mistakes
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.

Edit the HTML and re-run it
Runs in a sandbox. Nothing is sent.

Minimal snippet

color-input-example.html
<input type="color" name="brand_color" value="#ff6600">

Copy-paste code

HTML input type=color 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
input-type-color.html
<form action="https://splitforms.com/api/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">

  <!-- The backend receives brand_color=%232563eb (the # is URL-encoded as %23) -->
  <label for="brand_color">Brand color</label>
  <input type="color" id="brand_color" name="brand_color" value="#2563eb" list="brand-swatches">
  <datalist id="brand-swatches">
    <option value="#2563eb">
    <option value="#16a34a">
    <option value="#f97316">
    <option value="#111827">
  </datalist>

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

  <!-- Honeypot: hidden from people, bots fill it in -->
  <input type="checkbox" name="botcheck" style="display:none">

  <button type="submit">Send</button>
</form>

Attributes · <input type="color">

Which attributes work on a color input?

A color input has few attributes. value and list do most of the work.

HTML input type=color attributes and what each one does
AttributeWhat it doesDocs
valueThe starting color as a 6-digit hex with #, like value="#2563eb". Without it, the picker starts at #000000.MDN
listThe id of a <datalist> whose <option> hex values show as preset swatches in browsers that support it.MDN
nameThe key the color is sent under, like brand_color. Without a name, nothing is sent.
autocompleteLets the browser restore or suggest a value. Color inputs accept it, but most browsers do little with it.MDN

Common mistakes

Color input mistakes to avoid

Most problems come from the hex format and from expecting the field to be empty.

  1. Use a 6-digit hex value with #

    Set value as #rrggbb, in lowercase or uppercase; the browser stores it in lowercase. Named colors like red, 3-digit hex like #f60 and rgb() are rejected, and the field falls back to #000000.

  2. required never blocks the submit

    A color input always has a value, #000000 at the least, so required has no effect. To know if a visitor really picked a color, add a separate checkbox or compare against your default.

  3. There is no alpha or opacity

    The value is a solid color with no transparency. The newer alpha and colorspace attributes are not supported in every browser, so don't rely on them and collect opacity in a separate field.

  4. The # arrives as %23, so check it on the server

    In a form submission the # is URL-encoded, so the body holds brand_color=%232563eb. Most backends decode it for you. Anyone can send any text, so check the value matches ^#[0-9a-f]{6}$ (after lowercasing) on the server.

Sources: WHATWG HTML Standard: color state (type=color) · MDN: <input type="color">

Copy-paste ready

The HTML input type=color 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 input type=color 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 <input type="color"> form actually sends data to a free splitforms backend, with spam filtering built in.

How it works

How to add HTML input type=color to any page.

Copy the html input type=color 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 input type=color 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 payment forms →Need time slots? Online booking →

Setup guides for the stacks you use

Questions

HTML input type=color questions, answered.

View all FAQs
What value does input type=color submit?

A 7-character lowercase hex string such as #2563eb: a # followed by six hex digits for red, green and blue. In the form body the # is URL-encoded, so it is sent as brand_color=%232563eb.

How do I set a default color?

Put a 6-digit hex value in the value attribute, like value="#ff6600". Without a valid value, the color input starts at black, #000000.

Can a color input be empty?

No. A color input always has a value. If it has no value or an invalid one, it uses #000000, so it is always submitted and required can't block the form.

How do I offer preset color swatches?

Add a <datalist> with an id and <option> elements whose values are hex colors, then set list to that id on the color input. Browsers that support it show the options as swatches in the picker; the visitor can still choose any color.

How do I show the hex code next to the color picker?

Add an <output> element and listen for the color input's input event. In the handler, set output.value = input.value, so the hex code updates while the visitor drags in the picker.

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 per month, billed yearly
Best value

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

  • 15,000 submissions per month
  • 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