"Jukka K. Korpela" <
juk...@gmail.com> writes:
> Ben Bacarisse wrote:
>
>> Short version: how can I stop as many browsers as possible from offering
>> to supply names, addresses, emails and so on when users fill in a form
>> that has nothing to do with their details?
>
> Short answer: use the attribute autocomplete="off" on the <input> element(s)
> or, to affect all fields in a form, on the <form> element. Regarding browser
> support, see
>
https://caniuse.com/?search=autocomplete
Thank you. I should have mentioned that I'd tried the supposed standard
solution. Unfortunately it does not stop Chrome which I know is popular
with my target users. I am beginning to think this is just a Chrome
issue, though I don't use other browsers (except Epiphany) well enough
to know how exactly how their form filling works.
>> Advice from the web suggests that, for some recent browsers, putting
>> "autofill=xzzy-or-some-other-garbage" will help. For Chrome on Android,
>> that stops names (for example) being suggested, but a blank bar with a
>> key, a credit card and a location icon still pops up.
>
> I cannot figure out what you mean here. A code sample might help.
The problem I am describing here is a UI one. Anyway, the code (to use
the "proper" attribute) is
<input type=tel name=number autocomplete=off>
<button type=submit>save</button>
(wrapped in a form, of course)
With recent Chrome on Android, when I tap in the input field, the
browser adds a solid white bar above the virtual keyboard with my phone
number in it. With a junk value for autocomplete the browser (Chrome)
won't offer my number by still adds a solid white bar with three
"helpful" icons on it. I'd really like to be able to tell Chrome that
there is no useful autocomplete action and not to clutter the UI by
trying.
(I've also tried autocomplete=off on the form as well, since reports
suggest that this, too, alters the behaviour in some browsers.)
> Anyway, there are various quirks related to the autocomplete attribute and
> to various browsers, e.g. for password fields, so a long answer could be
> really long.
A lot of the posts I've seen discuss passwords fields and that's the
only case I don't care about! The app does have both a 'login' and a
'change password' page but these are cases where the data /do/ belong to
the user, and so any autocomplete the browser wants to do there is fine
with me.
It's offering to put the user's phone number into a field when I know
they are entering someone else's number that is (slightly) bothersome.
That's the thread where I got the suggestion of using a junk attribute
value from, though I seem to recall the suggestion mentioned autofill
rather than autocomplete. That may have been a typo since autofill is
the name of a related CSS pseudo-class.
Since most reports of browsers ignoring autocomplete=off seem to relate
to login forms, maybe my best option is simply to suggest that users
avoid Chrome or live with the minor annoyance.
--
Ben.