🧩 The Browser Fills In the Wrong Field Every Single Time
A checkout form has separate fields for billing and shipping address, and the browser’s autofill keeps putting the wrong data in the wrong field – or ignoring the form entirely – frustrating users who expect one-click autofill to just work like it does everywhere else.
🐞 The Problem
<input type="text" name="street1" placeholder="Billing Street">
<input type="text" name="street2" placeholder="Shipping Street">
<!-- No autocomplete attributes at all - the browser has to
GUESS what each field is for based on name/placeholder,
and often guesses wrong or refuses to fill anything. -->
🔍 Why This Happens
Modern browsers rely primarily on the HTML autocomplete attribute - a standardized vocabulary (like "given-name", "street-address", "cc-number") - to know exactly what each field represents. Without it, heuristics based on name/id/placeholder text are a fallback of last resort and are notoriously unreliable, especially for forms with more than one address (no reliable way to guess "billing" vs. "shipping" from a generic label alone).
✅ The Fix: Add Explicit autocomplete Attributes to Every Field
- Use the standardized token vocabulary for every relevant field:
autocomplete="given-name","email","tel","cc-number", etc. — these are defined by the HTML spec and recognized consistently across browsers. - For forms with MULTIPLE address groups, prefix the section:
autocomplete="shipping street-address"vs.autocomplete="billing street-address"— this is the specific mechanism that tells the browser which group a field belongs to. - Use
autocomplete="off"deliberately only for fields that genuinely should never autofill (a one-time coupon code) — applying it broadly “to be safe” actively breaks the experience for password fields and address forms alike.
📦 Correct Version
<input type="text" name="street1"
autocomplete="billing street-address">
<input type="text" name="street2"
autocomplete="shipping street-address">
<input type="email" name="email" autocomplete="email">
<input type="tel" name="phone" autocomplete="tel">
Browsers don’t read your placeholder text the way a human does — the autocomplete attribute is the actual contract, and every field without one is a guess the browser is free to get wrong.




