Use this HTML form testing checklist to verify field behavior, validation, autofill, accessibility, encoding, and the request that reaches your server before a form is released.
Overview
A form can look correct and still fail in production. A missing name attribute can exclude a value from the submission. A custom error message may be invisible to keyboard and screen-reader users. A file upload may use the wrong encoding, while an apparently successful submit may send a different payload than the backend expects.
Test forms in layers: first confirm that the HTML structure represents each field correctly, then test native and custom validation, keyboard and assistive-technology behavior, autofill, and the final network request. Repeat the process for the browsers, devices, account states, and data conditions that matter to the form.
This checklist applies to signup, checkout, contact, search, login, profile, survey, and upload forms. It also works with server-rendered HTML and JavaScript frameworks, provided you inspect the rendered DOM and the actual request rather than relying only on component code.
Checklist by scenario
1. Test the field structure
- Give every submitted control a useful
name. Theidconnects a control to its label; thenameidentifies its value in the request. - Use a visible
<label>for each input, select, and textarea. Match the label’sforvalue to the control’sid, or place the control inside the label. - Check that related controls use a
<fieldset>and<legend>where a group needs a shared question, such as shipping options or notification preferences. - Use an appropriate
type:email,tel,url,number,date,search, andpasswordcommunicate intent and can provide useful browser behavior. - Confirm that checkbox, radio, select, and textarea values match the backend’s expected names and formats. Test both selected and unselected states.
- Ensure every submit control has a clear purpose. If a form has multiple submit buttons, test each button’s value and destination separately.
2. Test native and custom validation
- Submit the empty form and verify every required field is identified without relying on placeholder text.
- Test minimum and maximum lengths, numeric ranges, allowed patterns, invalid email or URL values, and whitespace-only input.
- Check whether the browser’s native validation is sufficient. If custom JavaScript validation replaces it, confirm that the same constraints still work when JavaScript is delayed, interrupted, or unavailable.
- Keep client-side validation convenient, but repeat essential validation on the server. A browser is not a security boundary and requests can be created outside the page.
- Make error text specific: identify the field, explain the problem, and state what a valid value looks like.
- After submission, preserve valid values where appropriate and return focus or a clear status message to the problem area.
3. Test keyboard and accessible interaction
- Complete the entire form with the keyboard. Tab order should follow the visual and logical order, and every interactive element should be reachable.
- Confirm that focus is visible against every background and is not removed by a CSS reset or custom component.
- Use the keyboard to open and operate custom selects, date pickers, dialogs, and file controls. If a native control works more reliably, prefer it unless there is a clear reason not to.
- Associate errors with controls using a suitable description relationship, such as
aria-describedby, and expose invalid state where custom validation requires it. - Test with a screen reader or accessibility inspection tool. Labels, instructions, required state, error state, and completion status should be understandable without visual positioning.
- Do not use color alone to identify required fields, errors, or success.
4. Test autofill and mobile input
Use autocomplete tokens that describe the data a field requests, such as email, name, given-name, family-name, street-address, postal-code, cc-number, or one-time-code when appropriate. Do not treat placeholder text as an autofill instruction.
- Test saved contact, address, password, and payment details where the form supports them.
- Confirm that autofilled values are visible, included in validation, and included in the submitted request.
- Check mobile keyboards: email fields should make the expected characters convenient, telephone fields should show a suitable keypad, and numeric fields should not reject valid leading zeros accidentally.
- Test zoom, rotation, small screens, and long error messages. The form should remain usable without horizontal scrolling.
- Verify that password managers and browser autofill do not place values in the wrong field after dynamic fields appear.
5. Test submission and encoding
Start with the form’s action and method. A GET form places successful controls in the URL query string and is useful for searches and repeatable filters. A POST form sends data in the request body and is commonly used when the operation changes server-side state. Confirm that the chosen method matches the workflow and that sensitive values are not exposed in a URL.
For a normal HTML form, inspect the request’s content type and body. URL-encoded data represents fields as key-value pairs; special characters, spaces, repeated names, and non-ASCII text must survive the round trip. A form containing file inputs generally requires enctype='multipart/form-data'. If JavaScript sends JSON with fetch, verify that the code sets the expected content type and serializes the same fields the server validates.
- Submit empty, single-value, multiple-value, Unicode, punctuation, and very long inputs.
- Test repeated field names, such as multiple checkboxes, and confirm how the backend receives them.
- Choose a real file, reject an unsuitable file type or size, cancel selection, and submit without a file.
- Use browser developer tools to inspect the request URL, method, status, headers, content type, form data, payload, redirect, and response.
- Compare the browser request with the backend contract. If needed, use an API payload debugging workflow to decode or reformat values while investigating.
Field-by-field test matrix
| Field type | Test cases | Verify |
|---|---|---|
| Text | Empty, whitespace, short, maximum, Unicode | Length rules, trimming policy, encoded value |
| Valid, malformed, plus sign, long address | Browser behavior, server validation, error association | |
| Password | Short, long, paste, reveal, mismatch | Autocomplete token, visibility control, clear errors |
| Select or radio | Default, each option, no selection | Allowed values and submitted name-value pair |
| Checkbox | Checked, unchecked, several checked | Boolean or repeated-value handling |
| File | Valid, invalid, large, canceled | Encoding, size/type handling, server response |
Accessible form markup reference
This compact pattern demonstrates a visible label, a hint, a required field, and an error relationship. Adapt the wording and validation state to your application rather than copying attributes without testing them.
<form action='/account' method='post'>
<div>
<label for='email'>Email address</label>
<p id='email-hint'>Use an address you can access.</p>
<input
id='email'
name='email'
type='email'
autocomplete='email'
required
aria-describedby='email-hint email-error'
aria-invalid='true'>
<p id='email-error'>Enter a valid email address.</p>
</div>
<button type='submit'>Create account</button>
</form>
In a passing state, remove or empty the relevant error message and update the invalid state consistently. For a complete page review, pair form testing with your broader web performance checks and responsive layout checks.
What to double-check
- Rendered HTML: Inspect the browser’s DOM, not only the source component. Framework rendering, hydration, conditional fields, and custom controls can change the final structure.
- Successful controls: Disabled controls are not submitted, unchecked checkboxes normally contribute no value, and controls without a name cannot be addressed reliably by the server. Verify these cases deliberately.
- State changes: Test loading, success, validation failure, server failure, timeout, duplicate clicks, and back-button behavior. A disabled button should not leave keyboard users without feedback.
- Security boundaries: Confirm server-side authorization, validation, upload handling, rate limits, and output escaping separately from browser behavior. A passing UI test does not prove the endpoint is safe.
- Query strings: For search and filter forms, check that spaces, reserved characters, repeated parameters, and empty values produce the intended URL. The URL query string guide is useful when comparing encoded and decoded requests.
- Storage and return paths: If a form saves drafts or restores a session, test expiration, private browsing assumptions, cleared storage, and multiple tabs using the browser storage debugging guide.
Common mistakes
- Using placeholders as labels: Placeholder text disappears and does not provide a dependable field name. Keep a visible label.
- Relying on
requiredalone: Native validation is helpful, but it does not replace server validation or a tested error experience. - Styling errors without announcing them: A red border may be obvious visually but meaningless to someone using a screen reader or high-contrast mode.
- Changing field names during a redesign: Renaming
customer_emailtoemailcan break handlers, analytics, integrations, and saved drafts. - Testing only the happy path: Empty values, pasted text, autofill, slow responses, duplicate submissions, and interrupted uploads often reveal the real defects.
- Inspecting only the response page: A success screen does not prove that the intended values, encoding, headers, or files reached the server. Inspect the network request.
- Replacing native controls unnecessarily: Custom widgets require extra keyboard, focus, semantics, and mobile testing. Use them only when they provide a clear user benefit.
When to revisit
Run this checklist before every form release, redesign, backend migration, analytics change, authentication change, or new payment or upload flow. Repeat a focused regression test whenever a field is added, renamed, made conditional, or given a new autocomplete token.
Revisit the checklist after browser, operating-system, framework, or assistive-technology updates that could affect validation, autofill, file selection, focus, or custom controls. It is also worth reviewing before seasonal campaigns and other high-traffic periods, when a small submission defect can affect more users than usual.
Keep a reusable QA record with the form URL, build version, test browser and device, field results, screenshots or request captures, accessibility findings, and backend response. Mark each item as pass, fail, blocked, or not applicable. Before release, fix failures or document an owner and follow-up date; after release, sample real requests and error logs to confirm that the tested behavior matches production.