How a contact form should work

The fields, labels, error messages, spam control, after-sending steps and tests behind a form that people finish and the firm can answer.

· 12 min readSoftware

Short answer

A good contact form asks only for what the first reply needs, gives every field a visible label above it, uses the right input type and autocomplete value, says what to fix and where when something goes wrong, and confirms the send both on the page and by email.

Picture this: a small architecture office has a contact form on its site. It has eleven fields, all of them required, with the hints written inside the fields. Someone opens it on a phone, types their name, moves to the next field and forgets what they were meant to write, hits an error and is thrown to the top of the page, and gives up. The office’s inbox has been empty for weeks, and nobody thinks the form could be the reason. If you ask how a contact form should work, the test has two sides: the visitor must be able to finish it, and the firm must be able to answer what arrives.

This article builds the form in eight steps. We covered the form’s place on a landing page in our landing page guide and the route from an enquiry to a quotation in our guide to automating the quote process; we do not repeat that here. Here we look at the form itself.

1. Test every field

Ask one question about each field: can I write the first reply without this information? If I can, the field goes. The table below shows the fields that are often enough for a contact form, why each one is there, and the input type it is built with. We explain the values in the third column in step 3.

Field Why it is there Input type and autocomplete
Full name Who the reply is addressed to text, name
Email Where the reply goes email, email
Phone A second route for someone who wants a call; required only if you will reply by phone tel, tel
Message The enquiry itself textarea
Company Only if you sell to companies text, organization

Putting first and last name in one field is also a choice. MDN writes that using the single name value is generally preferred to splitting the name into parts, because of how varied human names are. Adapt the table to your own business: if a field is there only because it “might be useful”, remove it.

2. Put the label above the field, and do not leave it to the placeholder

Give every field a visible label and tie the label to the field. According to W3C’s forms tutorial, a linked label enlarges the clickable area in the browser and lets assistive technology read out the field with the right name. On the same page W3C notes that designers sometimes propose leaving out visible labels, but that most users prefer, or even need, visible labels to understand a form.

A placeholder (the faint text inside a field) does not take the place of a label. W3C’s form instructions page says so plainly: placeholder text disappears when you start typing, which makes it harder to check what you entered. Screen readers do not treat it as a label, and browsers usually show it in a colour that does not meet WCAG’s minimum contrast requirement. If you use a placeholder, put an example value in it (such as “0555 123 45 67”); that is our advice.

On label position, W3C says that putting labels above the fields reduces horizontal scrolling for people with low vision and for mobile users, but adds that this depends on the surrounding elements and should be assessed for each form. We keep labels above the field; that is our default.

The example below shows how a label is tied to its field, along with the field types from step 3:

<label for="email">Email</label>
<input type="email" id="email" name="email" autocomplete="email" required>

<label for="phone">Phone (optional)</label>
<input type="tel" id="phone" name="phone" autocomplete="tel">

3. Choose the right input type and autocomplete value

The keyboard on a phone changes with the field type. W3C writes that when HTML5 field types are used, a virtual keyboard makes data entry easier; for example, a number field shows a numeric keyboard and a date field a native date picker. Using the matching type for email and phone follows the same logic; that inference is our advice.

The autocomplete attribute, in turn, tells the browser what a field is. According to MDN, the attribute gives the browser a hint about how, or even whether, to fill a field in; the values name, email, tel and organization are in that list. MDN also notes that, to offer autofill, browsers may require fields to have a name or id, a <form> and a submit button. So do not forget to name your fields.

Do not impose a strict format on the phone number. Accepting spaces, hyphens and a leading zero is our advice; losing a visitor over the format of a number costs more than sorting out a few untidy records.

4. Mark required fields, and say what is wrong next to the field

According to W3C’s form instructions, a form should show which input is required and which is optional. Placing overall instructions before the <form> element means screen readers read them before switching to forms mode. In practice, write one sentence above the form (“Fields marked with an asterisk are required”) and repeat the marker in the field labels.

For error messages, W3C’s user notification page describes two layers. The first is a list of errors at the top of the page. Each line refers to the label of the field, describes the error briefly, says how to correct it and states any format requirement, and gives an in-page link to the field. The second is in-line feedback next to the field. W3C also describes moving focus to the first field with an error after a failed submission as a convenience.

Write the wording to the same standard. “Invalid entry” says nothing; “The email address is missing an @ sign, for example name@company.com” says what happened and how to fix it. The visitor’s typing should not be wiped; that last sentence is our rule, not W3C’s.

Write the result of the action on the button: “Send message” or “Request an appointment” instead of “Submit”. W3C says that the label of a <button> is written inside the element; in other words, the button’s wording is a label too. We have examples of button wording in the landing page guide.

We are not stating a legal rule about consent. We covered the rules on consent and privacy notices in our guide to email and SMS consent in Türkiye, and we suggest you settle your texts with your own lawyer. In our web and software work we ask in forms only for what the job needs, put the link to the privacy notice beside the form, and take consent for commercial messages with a separate box that is not pre-ticked. web.dev also recommends linking to the privacy policy on every page with a form, especially if personal data is processed.

6. Keep spam out without a puzzle: the hidden field

To protect a form from bot submissions, web.dev lists several routes: a service such as reCAPTCHA, a “honeypot” (hidden field) and a filter such as Akismet. The same page carries an important warning: make sure spam protection is accessible, try it with a screen reader and with the keyboard alone, because protection that makes the form unusable for real people is useless.

A hidden field asks no puzzle. According to web.dev, a honeypot is a visually hidden form field; people will not see it, but bots will fill it in. The code on the server checks whether the field was filled, and if it was, the submission probably came from a bot and can be ignored. For example:

<div style="position:absolute;left:-9999px" aria-hidden="true">
  <label for="web">Leave this field empty</label>
  <input type="text" id="web" name="web" tabindex="-1" autocomplete="off">
</div>

In the example, tabindex="-1" keeps the field out of the Tab order and aria-hidden="true" hides it from screen readers. Its limits follow; these are our own assessment. A bot that never fills the field gets through, so a hidden field is not a security measure on its own and only filters out simple bots. Without a check on the server it does nothing. autocomplete="off" is a hint to the browser not to fill the field; it guarantees nothing, so check on your own phone and desktop that a real person does not fill the hidden field. If spam starts getting through, move to the other routes web.dev lists. The other checks that protect a site are collected in our website security checklist.

7. Set up what happens after sending

Even if the form works up to here, the real work starts after the send. After sending there are four stops; the figure below shows five boxes in order, counting the send itself.

  • Confirmation on the page. W3C’s user notification page says success messages matter for confirming that a task is complete; the confirmation can go in the main heading or the page title (such as “Thank you, your message has reached us”). The visitor should not leave the page unsure whether the form went.
  • Confirmation by email. A short reply should go to the visitor’s inbox saying the enquiry was received, who will look at it and when they can expect an answer. The time you promise should be a time you can keep; we described what this reply contains in the quote process guide. The confirmation email can also land in spam, and you only find that out by trying it.
  • One inbox, one owner. The enquiry should land in one place with one person’s name on it. An inbox with no owner is one where everyone assumes someone else is looking.
  • First human reply. An automatic confirmation does not count as an answer; the time to the first reply a person writes is your real measure.
The path after sending: the form is sent, the page confirms, a confirmation email goes out, the enquiry lands in one inbox with one owner, and a person writes the first reply Form is sent On-page confirmation Email confirmation One inbox, one owner First human reply The path after sending: the form is sent, the page confirms, a confirmation email goes out, the enquiry lands in one inbox with one owner, and a person writes the first reply Form is sent On-page confirmation Email confirmation One inbox, one owner First human reply
Figure: The path after sending; confirmation on the page, confirmation by email, one inbox with one owner, then the first reply a person writes.

8. Test it by hand, then measure

This step is our advice. Try the form in two ways: from your phone, and with the mouse put aside, using only the keyboard. On the phone, check that the right keyboard opens, that the labels stay visible with the fields, that the button is easy to press with a thumb and that the error message does not end up off screen. On the keyboard, confirm that you can reach every field with Tab, that the focus is visible and that Enter sends the form; the details of the keyboard check are in our web accessibility guide. Then see that the submission really reaches the inbox, that the confirmation email arrives and that it does not go to spam. Do not do this once and stop: as we describe in our website maintenance guide, an update can break a form silently.

Two numbers are enough for measuring: the number of visitors who reach the form and the number of successful sends. We call the ratio of the two the completion rate; that definition is our own usage. Count a successful send by the confirmation page or confirmation event being seen, not by a button click, and compare the count with the real number of enquiries in the inbox. If they do not match, either the measurement or the form is broken. For setting up the measurement correctly and testing changes, see our conversion rate guide.

Common mistakes

  • Collecting every topic in one form. When sales, support and press enquiries land in the same inbox, nobody knows on day one who answers. If necessary, turn the topic into a field and write down an owner for each option.
  • Not allowing for double submission. On a slow connection the visitor presses the button a second time; the same enquiry becomes two records and the measurement is inflated. Disable the button while the send is in progress and show the confirmation page straight away; that is our advice.
  • Changing several things at once. Once you have shortened the form, changed the button text and added a spam control, you cannot interpret the rate. Make each change one at a time and write down its date.

Common questions

How many fields should a contact form have?

There is no fixed number. The test above applies: as many fields as the first reply needs. For most businesses name, email and message are enough; make the phone field required only if you will reply by phone.

Can a placeholder be used instead of a label?

No. According to W3C, a placeholder is not a label; it disappears as you type and screen readers do not treat it as a label. Keep the label visible and put an example value in the placeholder.

Is a captcha required?

No. web.dev also lists options such as a hidden field and a filter. Whichever you choose, try it with the keyboard and a screen reader, and do the check on the server.

One step you can take alone today: fill in the form on your own phone with deliberate mistakes, then fill it in correctly and send it. Write down which inbox the message landed in, how many minutes it took and whether the confirmation email arrived. Give the resulting list to whoever builds the form. We also wrote down how we handle forms, including our answer on KVKK, on our web and software service page.

Sources

This article is general information, not legal, financial or technical advice. Platforms, their rules and the law change over time, so some details may have changed since 14 November 2026 or contain small errors. Before you make a decision for your business, check the current official sources or write to us.

Tell us about
your project.

Fill in the form or write to us directly, and we will agree on a day to talk.

Your first meeting is with Deniz Sezer, founder of Detmore.

First meeting free · Reply within one working day · Written proposal in 2 to 3 days · NDA ready

What do you need? pick as many as you like

Name, email and phone are required.

Contact

We reply within one working day.