Your contact form is a keyboard test: we audited ours, attribute by attribute
DEV Community

Your contact form is a keyboard test: we audited ours, attribute by attribute

Every enquiry that arrives on a phone passes through a keyboard before it becomes a lead.

On 7 December 2026 we fetched our own live contact page - the rendered HTML, the four CSS files it loads and the JavaScript that handles submission - and scored the form against the attributes that decide whether a thumb-driven visitor actually finishes it.

This is not a rewrite announcement. It is an audit: what the form already gets right, the three places where it still costs the person on the other end, and a ten-minute version you can run on your own site.

How we checked

We pulled contact.html and its assets with a desktop browser user-agent, read the form markup, the form-related CSS rules and the submit handler in interactions.js, and computed contrast ratios from the declared colours.

We did not submit the form: no test enquiries were pushed into the studio's inbox. Everything below is read from source, not from a lab of real devices - the limitation is stated at the end.

The page carries two forms: a card on the contact page (#contact-form) and an appointment modal (#talk-form). Both matter; the modal is where "Book Appointment" buttons across the site land.

The attribute set that decides mobile completion

  • Visible, linked <label for> on every field: Yes / Yes
  • type="email" / type="tel": Yes / Yes
  • autocomplete="name" / "email" / "tel": Yes / Yes
  • Numeric keyboard for the security question (inputmode="numeric", pattern="[0-9]*"): Yes / Yes
  • Input font-size 16px (the iOS zoom threshold): Yes / Yes
  • Control height ≥ 48px, button full-width 52px: Yes / Yes
  • Single column below 1024px: Yes / Yes
  • Per-field error text linked with aria-describedby: No / No
  • Validation before submit (blur / input): No / No
  • enterkeyhint / tel-country-code / tel-national: No / No

What already passes, and why it matters

Labels are real <label for="id"> elements, not placeholders pretending to be labels - the text survives after the first keystroke and screen readers announce the field name.

type="email" and type="tel" summon the right keyboard instead of the full alphabet. The autocomplete tokens let a phone's saved identity fill name, email and phone in two taps.

The CSS rule for inputs declares font-size: 16px, and the mobile stylesheet repeats it with the comment prevent iOS zoom - the detail that stops Safari from zooming the viewport when a field is focused.

On the contact card, inputs carry min-height: 52px; on small screens the whole grid collapses to one column at 1024px, fields go full-width at 768px with a 48px floor, and the submit button is 100% wide and 52px tall.

The security question expects a number, so it asks for the numeric keypad, and a 48px refresh button sits beside it.

The focus state is a 2px orange outline at outline-offset 1-2px. Measured against white, the shipping orange #FF5200 is 3.25:1 - under the 4.5:1 that text needs, above the 3:1 that WCAG asks of non-text UI like focus rings. For a ring, that passes.

That is a solid baseline. Most small-business forms fail several of those checks before you even open DevTools.

Where it still costs the visitor

1. Errors belong to fields, not to the form

Both forms report one message in a single paragraph at the bottom: Please complete name and phone (10+ digits). - with role="alert" so it is announced. But nothing ties the message to the field that failed.

A screen-reader user hears the summary and then has to hunt through the form; a sighted user on a phone often does not see the paragraph at all when the keyboard covers the lower half of the screen.

The fix is small and mechanical:

<input id="phone" name="phone" type="tel" required autocomplete="tel" aria-describedby="phone-error">
<p class="field-error" id="phone-error" hidden></p>
function markInvalid(field, message) {
  const err = document.getElementById(field.getAttribute('aria-describedby'));
  field.setAttribute('aria-invalid', 'true');
  err.textContent = message;
  err.hidden = false;
}
function clearInvalid(field) {
  const err = document.getElementById(field.getAttribute('aria-describedby'));
  field.removeAttribute('aria-invalid');
  err.hidden = true;
}

On a failed submit, focus the first invalid field. Keep the summary paragraph as well - it is the announcement, the per-field text is the map.

Also worth knowing: because the inputs carry required and the form has no novalidate, the browser's native constraint validation runs first and the JS handler is a backstop (its digit-count rule and the security answer). Native validation on mobile is fast and localised; if you add custom per-field messaging, decide deliberately whether to take over entirely (novalidate) or only wire the JS-only rules. Half-and-half is how forms end up with two different error languages.

2. Validation lives at the wrong moment

Right now a visitor learns about a problem only after pressing the button. The better rhythm for long forms is: validate a field when it loses focus, show the message next to it, then re-validate on every keystroke once that field has been flagged.

Typing a phone number should not flash red at the fourth digit.

field.addEventListener('blur', () => field.dataset.touched = '1');
field.addEventListener('input', () => {
  if (field.dataset.touched) validateField(field);
});

Short forms survive submit-time validation; five fields plus a security question on a 390px screen is exactly where it starts to hurt.

3. The phone field is two controls wearing one label

A country-code <select> (26 options, +91 first) sits beside a national-number input with autocomplete="tel". Autofill can drop a full international number into the national box - and the handler already guards the worst case: it prepends the selected code only when the number does not start with +.

Two refinements:

<select name="phone_code" autocomplete="tel-country-code">…</select>
<input name="phone" type="tel" autocomplete="tel-national" inputmode="tel" enterkeyhint="next">

tel-country-code and tel-national are the precise tokens for a split field; enterkeyhint turns the return key into "next" through the form and "send" on the last field, which on Android is the difference between a keyboard closing and a keyboard doing what the user expects.

The ten-digit floor (digits.length < 10 on the national part) is a reasonable Indian default. If you accept international numbers, the rule should move to per-country lengths or a loose sanity check plus server-side verification - a 9-digit Singapore mobile would be rejected by the current rule.

One deliberate decision worth keeping: email and message are optional; name and phone are required. For a phone-first studio that is honest. If email becomes the primary reply channel, the trade-off reverses.

The ten-minute check for your own site

Open your contact page in DevTools device mode at 390px width. Focus a field and watch whether the page zooms (iOS Safari) - if the input font-size computes below 16px, it will.

Tab through the whole form. Every stop should show a visible focus ring, and the order should follow the visual order.

Submit it empty. Count how many clicks or how much guessing it takes before you know exactly which field is wrong and why.

Inspect the inputs: type, autocomplete, inputmode and enterkeyhint. All four are free; most forms are missing at least two.

Turn on a screen reader for five minutes. If the error summary is all you get, add the aria-describedby wiring above.

What we did not test

This audit is source-level: one live page, read on one day, with no real-device matrix and no drop-off analytics. We could not measure how many visitors actually abandon the form, because that instrumentation is not configured - missing data is not zero.

The next honest step for our own form is field-level events with consent, not more opinions. The fixes above are prepared but not deployed; changing the live form is a separate, owner-approved step.

We build and fix sites like this at Design Den Solutions - responsive builds, forms and integrations belong to our web development service. If you want this checklist run against your own enquiry form, the studio is at www.designdensolutions.com or +91 98721 90965.

Article prepared with AI assistance and reviewed for accuracy by Design Den Solutions. Cover image generated with AI and composited with the unchanged official Design Den Solutions logo; it is a conceptual illustration, not a screenshot.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.