Disabling Chrome Autofill
To disable Chrome's autofill function, you can utilise:
- A hidden input with an unpredictable name for the autofill feature, and set the
autocomplete
attribute to "new-password". - Set the
autocomplete
attribute for your actual input field to "off".
Please note, this is a workaround and its effectiveness might be compromised by future browsers' updates.
Applying autocomplete
attribute
The autocomplete
attribute can be a powerful tool when used judiciously, it can enhance user experience, yet thwart unwarranted autofill suggestions.
OTP fields and autofill
Autofill for One-Time-Password fields can be avoided with:
Workaround for address fields
Disable the autofill feature for address fields with this clever trick:
Pioneering with non-standard and generic inputs
Venturing into unexplored territories with autocomplete
values or using generic IDs can yield unexpected results:
Outsmarting autofill and staying vigilant
Chrome's autofill is like that clingy friend who never gets the hint. To keep it at bay, you gotta stay on your toes.
Hidden fake inputs and invisible fields
Incorporate hidden fake inputs or off-screen fields:
Readonly until user interaction
Set fields to readonly and enable them when the user interacts:
User's in command
Remember to let users know how to manage incorrect autofill data in Chrome's settings. Purchasing the ship doesn't make one the captain, does it?
Stay dynamic
If everything fails, let JavaScript take the wheel and outsmart autofill:
Was this article helpful?