Chrome Ignores Autocomplete="Off"
Override Chrome's autocomplete by assigning an offbeat value to autocomplete
. For instance, you might use "new-password"
for password fields to no-fill expectations or a random string for others, tricking Chrome into disregarding autofill.
Example for text inputs:
For password fields:
You can directly include these attributes in your HTML for hassle-free Chrome autofill handling.
Outsmarting Chrome's stubborn autofill
With often overzealous attempts to assist users, browser autofill may ignore autocomplete="off"
. This section delves deeper into methods that have proven effective against this stubborn mechanism.
Dynamic control using JavaScript
By altering the autocomplete
attribute dynamically, JavaScript offers control over input fields:
Decoy form fields to the rescue
Insert invisible, non-functional form fields to throw off the autofill mechanism:
Obfuscation never looked so good
Creativity meets function with offbeat attribute values like "no-fill-today-thanks" or "new-password" taking Chrome's autofill for a ride.
Readonly until given focus
Implement fields as readonly
, making them editable when users click on it:
Search input to the rescue
Swapping out your standard <input type="text">
for <input type="search">
combined with autocomplete="off"
may yield better success:
Staying in the know
Browser behaviors aren't set in stone; keep an eye on the latest updates from browser developers to stay ahead of the game.
Mastering the art of control: Techniques for smarter forms
Silencing Chrome's autofill feature calls for a concoction of cunning and UX understanding. Here are some advanced tactics that can help you fine-tune your approach:
Translucent decoys
Browsers don't fill fields they can't see. Set opacity to 0 and position the field absolutely to keep it hidden:
jQuery firepower
Employ jQuery to dynamically append fields with custom autocomplete
attributes:
Make attribute values unique
Customize the attribute values for a shot at by-passing Chrome's logic:
Testing across the board
Ensuring a consistent user experience across all browsers is paramount – always validate your solutions on diverse browsers.
Was this article helpful?