splitforms.com

HTML · INPUT TYPE

HTML input type search: search boxes and GET forms

Last reviewed

An <input type="search"> is a text field meant for search queries. Most browsers add a clear (x) button, and phones can show a search key on the keyboard. Put it in a form with method="GET" and the query is sent in the URL, such as /search?q=red+shoes.

  • 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

search-input-example.html
<form role="search" action="/search" method="GET"><input type="search" name="q" aria-label="Search"></form>

Copy-paste code

HTML Input Type Search 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-search.html
<!-- A GET site search: the query goes to your own /search page in the URL.
     No access_key here, because this is not a form backend submission. -->
<form role="search" action="/search" method="GET">
  <label for="site-search">Search the site</label>
  <input type="search" id="site-search" name="q"
         enterkeyhint="search" autocomplete="off"
         placeholder="e.g. contact form">

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

Attributes · <input type="search">

Which HTML Input Type Search attributes matter?

These attributes decide how the <input type="search"> behaves and what actually gets emailed to your inbox when someone submits.

HTML Input Type Search attributes and what each one does
AttributeWhat it doesDocs
nameThe key the query is sent under. q is the usual name, so the URL ends in ?q=.... Without a name, nothing is sent.
enterkeyhintUse search so mobile keyboards label the Enter key as Search.MDN
placeholderAn example query, like e.g. contact form. It disappears on typing, so it is not a label.MDN
minlength / maxlengthThe fewest and most characters allowed. minlength only checks a field that isn't empty.MDN
listThe id of a <datalist> whose options show as suggestions. Visitors can still type anything.
spellcheckSet spellcheck="false" to stop red underlines on product names and codes.MDN

Common mistakes

HTML Input Type Search not working? Here's why.

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

  1. It works like a text input

    type=search has no validation beyond a text input. Any text passes, so minlength, maxlength and pattern are the only checks you get.

  2. The clear (x) button looks different in each browser

    Chrome, Safari and Edge draw their own clear button, and Firefox may not show one. In WebKit and Blink browsers you can style or hide it with ::-webkit-search-cancel-button.

  3. Mark the form as a search landmark

    Put role="search" on the <form>, or wrap it in the <search> element, so screen reader users can jump straight to it.

  4. GET puts the query in the URL

    With method="GET" the query shows up in the address bar, browser history and server logs. Don't use a GET search form for private data.

  5. Spaces become + in the query string

    The form encodes the query, so red shoes arrives as ?q=red+shoes. Your server decodes it back to a space.

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

Copy-paste ready

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

How it works

How to add HTML Input Type Search to any page.

Copy the html input type search 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 Search 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 Search questions, answered.

View all FAQs
What is the difference between input type search and type text?

Both accept any text. type=search tells the browser the field is for searching, so most browsers add a clear (x) button, phones can show a search key, and some browsers style it as a search box.

How do I remove the clear button from a search input?

In Chrome, Safari and Edge, hide it with CSS: input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }. Firefox does not add one by default.

How does the search query reach the backend?

In a form with method="GET", the browser adds the field's name and value to the action URL, so a field named q with the text red shoes sends /search?q=red+shoes. Your server reads the q parameter from the query string.

How do I submit a search input when the user presses Enter?

Put it inside a <form>. Pressing Enter in the field already submits the form, so no JavaScript is needed. Add enterkeyhint="search" so mobile keyboards label the key Search.

How do I add suggestions to a search input?

Add a <datalist> with an id and some <option> values, then set list to that id on the input. The browser shows matching options as suggestions, and visitors can still type anything.

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