WEMAXA.COM Design · Development · AI · Available worldwide
Studio / Wemaxa 01
Status Active Location Worldwide Focus Web + AI Delivery Remote Response < 1 Business Day
Tutorial 041Web Design & Development13 steps3 fixes

How to Build an Accessible Contact Form

A beginner, hands-on guide to build an accessible contact form with browser inspection, exact code-level changes and verification.

By the end: You will implement and verify build an accessible contact form on a real local/staging page.

TARGET RESULTHow to Build an Accessible Contact Form

You will implement and verify build an accessible contact form on a real local/staging page.

Key terms before you start

These definitions make the steps easier to follow and help distinguish controls, files and concepts that can look similar at first.

HTMLHyperText Markup Language; it describes the structure and meaning of web content.
CSSCascading Style Sheets; it controls presentation such as layout, spacing, color and responsive behavior.
Browser Developer ToolsBuilt-in browser tools for inspecting HTML/CSS, network requests, responsive layouts and console errors.
Keyboard focusThe currently active interactive element for keyboard input; users need a visible focus indicator.
HTML elementA structural part of a web document, e.g. <p>, <h2>, <a>, <button> or <nav>.

What you need before starting

  • A page you are allowed to edit
  • Access to the HTML/CSS/JS or CMS/template that renders it
  • A modern browser with Developer Tools
FULL TUTORIAL

Step-by-step tutorial

Every step is shown below. Work through them in order and use each checkpoint to confirm the result before moving on.

01
STEP 01 / 13

Work on a local or staging copy

Do this

Open the project containing the website source. If this is a production site, use a staging copy or backup before structural changes.

Why

A browser page is rendered from source files/CMS output; DevTools edits do not save back to the server.

Browser Developer ToolsBuilt-in browser tools for inspecting HTML/CSS, network requests, responsive layouts and console errors.
IF THIS GOES WRONGThe fix works only in DevTools

Move it into the actual source and reload.

CHECKPOINTYou know which source file/template controls the page.
02
STEP 02 / 13

Open the page in a modern browser

Do this

Load the page, then press F12 or Ctrl+Shift+I (Windows/Linux) to open Developer Tools.

Why

DevTools lets you inspect the DOM, applied CSS, computed sizes, requests and console errors.

Browser Developer ToolsBuilt-in browser tools for inspecting HTML/CSS, network requests, responsive layouts and console errors.
IF THIS GOES WRONGThe fix works only in DevTools

Move it into the actual source and reload.

CHECKPOINTDevTools is open beside the page.
03
STEP 03 / 13

Create a form element

Do this

Wrap fields in <form> and set the real submission method/action handled by your backend/framework.

Why

HTML alone does not deliver email without server/application handling.

HTMLHyperText Markup Language; it describes the structure and meaning of web content.
CHECKPOINTSubmitting reaches the intended handler.
04
STEP 04 / 13

Create a visible Name label

Do this

Use <label for="name">Name</label> and matching input id="name".

Why

The for/id link gives the field an accessible name.

Keyboard focusThe currently active interactive element for keyboard input; users need a visible focus indicator.
CHECKPOINTClicking label focuses input.
05
STEP 05 / 13

Use the email input type

Do this

Use <input type="email" ... autocomplete="email">.

Why

Browsers can provide useful input/keyboard behavior and basic format validation.

Keyboard focusThe currently active interactive element for keyboard input; users need a visible focus indicator.
CHECKPOINTMobile keyboard offers email-friendly keys.
06
STEP 06 / 13

Add a message label and textarea

Do this

Use a visible label plus <textarea>.

Why

Do not rely on placeholder as the only label.

Keyboard focusThe currently active interactive element for keyboard input; users need a visible focus indicator.
IF THIS GOES WRONGThe fix works only in DevTools

Move it into the actual source and reload.

CHECKPOINTLabel remains visible while typing.
07
STEP 07 / 13

Mark only truly required fields

Do this

Use required for fields the process cannot accept without.

Why

Do not make phone mandatory if email is sufficient.

IF THIS GOES WRONGThe fix works only in DevTools

Move it into the actual source and reload.

CHECKPOINTRequired state matches business need.
08
STEP 08 / 13

Write specific error messages

Do this

On server/client validation, explain what needs fixing beside the field.

Why

“Invalid input” is less useful than “Enter an email address”.

Keyboard focusThe currently active interactive element for keyboard input; users need a visible focus indicator.
CHECKPOINTUser knows how to correct error.
09
STEP 09 / 13

Preserve entered values on errors

Do this

Do not wipe a long message because one field failed.

Why

Avoid forcing users to retype valid information.

Browser Developer ToolsBuilt-in browser tools for inspecting HTML/CSS, network requests, responsive layouts and console errors.
CHECKPOINTCorrect fields retain values.
10
STEP 10 / 13

Add a truthful success state

Do this

After successful submission, say it was received and what happens next.

Why

Do not claim “we will respond in 1 hour” unless operationally guaranteed.

CHECKPOINTUser knows submission status.
11
STEP 11 / 13

Test with keyboard only

Do this

Complete all fields and submit without mouse/touch.

Why

This catches labels, focus order and inaccessible custom controls.

Keyboard focusThe currently active interactive element for keyboard input; users need a visible focus indicator.
IF THIS GOES WRONGThe fix works only in DevTools

Move it into the actual source and reload.

CHECKPOINTThe form is completable with keyboard.
12
STEP 12 / 13

Test the public/staging URL logged out

Do this

Open the final URL in a private/incognito window.

Why

CMS/admin sessions can hide caching, permission or styling differences.

IF THIS GOES WRONGThe public page differs from staging/editor

Check caching, loaded asset URL, theme/template and logged-out view.

CHECKPOINTThe visitor view matches the intended result.
13
STEP 13 / 13

Document the changed file/rule

Do this

Record the file/template/component and purpose of the change in the project notes or version-control commit.

Why

Future maintainers should not have to reverse-engineer why a rule exists.

HTML elementA structural part of a web document, e.g. <p>, <h2>, <a>, <button> or <nav>.
IF THIS GOES WRONGThe public page differs from staging/editor

Check caching, loaded asset URL, theme/template and logged-out view.

CHECKPOINTThe change has a traceable reason/location.
CONCRETE EXAMPLEVerification rule

Reload the real page and reproduce the result after all temporary DevTools edits are gone.

Concrete examples

Verification ruleReload the real page and reproduce the result after all temporary DevTools edits are gone.

Copyable example

Accessible field example
<label for="email">Email address</label>
<input id="email" name="email" type="email" autocomplete="email" required>

<label for="message">Message</label>
<textarea id="message" name="message" required></textarea>

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

Troubleshooting

The fix works only in DevTools

Move it into the actual source and reload.

The public page differs from staging/editor

Check caching, loaded asset URL, theme/template and logged-out view.

You cannot tell which rule wins

Use the Styles/Computed panels to trace the final value instead of adding stronger selectors blindly.

FINAL CHECKDocument the changed file/rule

The change has a traceable reason/location.

Documentation and references

Use these primary and supporting sources to verify current controls, browser behavior and product-specific details.