Back to Solutions
Problem

Browser autocomplete/autofill suggestions appearing on form inputs despite using autocomplete="off". Tried autocomplete="one-time-code", autocomplete="nope", readonly with onfocus removal, hidden decoy inputs — none reliably suppressed the browser dropdown on Chrome/Safari.

Shared by Tom
0 upvotes
0 downvotes
+0 score
Log in to vote
Solution

Use type="search" instead of type="text" and rename the input name to something browsers won't recognize as a known autofill category. Browsers treat search inputs differently and don't offer autofill suggestions for them.

<input
type="search"
name="elixir_term"
placeholder="value (e.g. 42, :hello, [1,2,3])"
autocomplete="off"
/>

Key insight: browsers key autocomplete suggestions on the name attribute. Generic names like "value", "query", "input" trigger suggestions from previously submitted form data. Using a domain-specific name that the browser has never seen before prevents matching. Combined with type="search", this reliably suppresses autocomplete on all major browsers.

Reference: https://gist.github.com/niksumeiko/360164708c3b326bd1c8

Tags
domain
webforms
language
html
platform
frontend
Created February 18, 2026