You shipped a contact form, the submissions arrive, and everything looks fine. Then someone using a screen reader tells you the fields were just called "edit text", or a keyboard user could not tell whether the message went through. Those visitors do not complain twice. They leave, and you never see the lead you lost.
An accessible contact form is a form whose every field has a programmatically linked label, whose errors are announced and tied to the field that caused them, and which can be completed with a keyboard alone. This guide builds one on a static site using plain HTML, a small script, and a hosted endpoint from SimpleForm, a form backend that receives submissions from any HTML form without server code.
What makes a contact form accessible?
A contact form is accessible when a person using a screen reader, a keyboard, voice control or zoom can find every field, understand what it wants, fix mistakes and know when the message was sent. Four things carry most of that weight: labels, error messages, focus order and status announcements.
The guidance comes from the W3C Web Content Accessibility Guidelines. The relevant success criteria are 3.3.2 Labels or Instructions, 3.3.1 Error Identification, 1.3.5 Identify Input Purpose and 4.1.3 Status Messages. The W3C Web Accessibility Initiative also publishes a forms tutorial that covers the same ground in more depth.
| Problem visitors hit | Cause in the markup | Fix |
|---|---|---|
| Screen reader says "edit text" | Placeholder used instead of a label | A <label for> matching the input id |
| Error appears but is never read out | Message injected with no live region | A container with role='alert' or aria-live |
| Keyboard user loses their place after an error | Focus stays on the submit button | Move focus to the first invalid field |
| Browser cannot autofill the email | No autocomplete attribute | autocomplete='email' on the field |
| Success message unnoticed | Text swapped in silently | Write it into a role='status' region |
Why are placeholders not a substitute for labels?
Placeholders disappear as soon as someone types, so they are not a reliable label. They also tend to render in low-contrast grey, and some assistive technology does not announce them as the field name at all.
Use a visible <label> above each field and connect it with for and id. Clicking the label then focuses the input, which also gives mouse and touch users a larger target. Keep the placeholder only for a format hint, such as an example email address, never for the field name.
How do you write the form markup?
Write each field as a label and input pair, add autocomplete tokens, mark required fields with the required attribute, and point the form at your endpoint. The markup below is the whole front end, and it works with no JavaScript at all.
<form id='contact' action='https://simpleform.dev/f/YOUR_TOKEN' method='POST' novalidate>
<p id='form-status' role='status' tabindex='-1'></p>
<label for='name'>Your name</label>
<input id='name' name='name' type='text' autocomplete='name' required>
<p id='name-error' class='field-error' hidden></p>
<label for='email'>Email address</label>
<input id='email' name='email' type='email' autocomplete='email' required aria-describedby='email-error'>
<p id='email-error' class='field-error' hidden></p>
<label for='message'>Message</label>
<textarea id='message' name='message' rows='6' required></textarea>
<button type='submit'>Send message</button>
</form>The novalidate attribute turns off the browser's default bubbles so your own messages, which you control and can word clearly, take over. Without JavaScript the form still posts normally, because the action and method do the work.
How should you show and announce validation errors?
Show each error next to its field, say which field it belongs to, and tell the person how to fix it. "Enter an email address like name@example.com" is useful. "Invalid input" is not. Then set aria-invalid='true' on the field and link the message through aria-describedby so a screen reader reads the problem when the field is focused.
Colour alone must never be the signal. A red border with no text fails WCAG 3.3.1, because someone who cannot see the colour gets no information. Pair the colour with words and, if you like, an icon.
Here is the script that ties it together. It validates, writes the messages, moves focus to the first problem, and sends the data with fetch only when everything passes.
const form = document.getElementById('contact');
const status = document.getElementById('form-status');
form.addEventListener('submit', async (e) => {
e.preventDefault();
status.textContent = '';
const bad = [...form.elements].filter(el => el.willValidate && !el.checkValidity());
form.querySelectorAll('[aria-invalid]').forEach(el => el.removeAttribute('aria-invalid'));
form.querySelectorAll('.field-error').forEach(p => { p.hidden = true; p.textContent = ''; });
if (bad.length) {
bad.forEach(el => {
el.setAttribute('aria-invalid', 'true');
const msg = document.getElementById(el.id + '-error');
if (msg) { msg.textContent = 'Check the ' + el.labels[0].textContent.toLowerCase() + ' field.'; msg.hidden = false; }
});
bad[0].focus();
return;
}
const res = await fetch(form.action, {
method: 'POST',
headers: { 'Accept': 'application/json' },
body: new FormData(form),
});
status.textContent = res.ok
? 'Thanks, your message was sent.'
: 'Sorry, the message was not sent. Please try again in a few minutes.';
status.focus();
if (res.ok) form.reset();
});How do you tell people the message was sent?
Write the result into an element with role='status', which tells assistive technology to announce changes politely without stealing focus mid-sentence. That is the pattern WCAG 4.1.3 Status Messages describes, and it is why the form above has an empty status paragraph before the first field.
Moving focus to that element after submit is a deliberate choice. It lets a keyboard user continue from the confirmation instead of tabbing back through the whole page. Setting tabindex='-1' makes the paragraph focusable by script without adding it to the normal tab order.
If you would rather send people to a thank-you page, SimpleForm supports a custom redirect URL on every plan. Give that page a clear heading and a link back to where they were.
What does the form backend have to do with accessibility?
The backend decides what happens when a request fails, and your interface has to describe that honestly. SimpleForm documents its response codes: 200 for an accepted submission, 400 for missing or invalid data, 402 when the plan's monthly limit is exceeded, 403 for a disallowed origin, 404 for an unknown endpoint and 429 when the rate limit is hit. Each one deserves its own sentence in the status region rather than a single generic failure.
Spam protection matters here too. A visible CAPTCHA puzzle is one of the least accessible things you can put on a form. SimpleForm includes a hidden honeypot field and per-IP rate limiting on every plan, which cost real visitors nothing. If you add the honeypot yourself, hide it with CSS and give it tabindex='-1' and aria-hidden='true' so keyboard and screen reader users never land in it. Pro and Agency plans add optional reCAPTCHA v3, which scores visitors without showing a challenge.
The endpoint URL, the field names and the response codes are all in the SimpleForm documentation, and the plan limits sit on the pricing page.
How do you test the form before you publish?
Test it with the input methods your visitors use, not just with an automated checker. Automated tools catch missing labels and low contrast, but they cannot judge whether an error message makes sense. Work through this list in order.
- Unplug the mouse and tab through the form. Every field and the button must be reachable, in reading order, with a visible focus outline.
- Submit it empty. Focus should jump to the first invalid field and the error text should be read out.
- Turn on a screen reader (VoiceOver, NVDA or TalkBack) and listen to each field. The label, the required state and any error must all be spoken.
- Zoom the page to 200 percent and check that nothing overlaps or scrolls sideways.
- Submit a valid message and confirm the status text is announced and the email arrives.
Will an accessible form cost you anything?
The most likely objection is that this is extra work for a small audience. In practice it is a handful of attributes and one script, and the same changes improve autofill, mobile typing and error recovery for everyone. The real cost is skipping it, since a form people cannot finish is a form that does not collect leads.
On the hosted side the cost is nothing to start. The Free plan includes 100 submissions per month and 3 forms, with no credit card, and the markup above works on it unchanged.
Ready to try it on your own form?
Create a free SimpleForm endpoint, paste its URL into the action attribute of the markup above, and send yourself a test message with a screen reader running. Setup takes a few minutes, and you can see the submission in your dashboard straight away.
Frequently asked questions
No. Native HTML does most of the work. A label with a matching for and id, plus required and autocomplete attributes, covers the basics. Add ARIA only where HTML has no equivalent, such as aria-invalid on a field with an error, aria-describedby to link its message, and role status for the confirmation text.
No. A placeholder vanishes once the visitor types, often has weak contrast, and is not announced consistently by assistive technology. Use a visible label element linked to the input, and keep the placeholder for an example format only, such as an email address pattern.
Move focus to the first invalid field and make sure its error message is linked with aria-describedby. That puts the keyboard user exactly where the fix is needed and causes the screen reader to read the problem aloud, so nobody has to hunt back through the form.
Yes. Accessibility is decided in your HTML and front-end script, not on the server. You still need somewhere to receive the submission, so point the form action at a hosted form endpoint such as SimpleForm, then handle its response codes in your own status message.
Use defences that do not ask visitors to solve anything. A hidden honeypot field removed from the tab order and hidden from assistive technology, plus server-side rate limiting, stops most bots. Invisible scoring such as reCAPTCHA v3 adds protection without showing a puzzle.