Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-05-13 11:25:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Google Chrome and autocomplete=off violation

Trying to implement an address autocompleter using Capture+ on a checkout page, which is great. But under Chrome, when you visit, say, the ‘address’ field and start typing, you get two auto-suggest popups appearing on top of one another; the wanted one from Capture+ and an unwanted one from Chrome’s password store system.

Capture+ assigns autocomplete="off" to all fields in which it has a vested interest to try and stop this behaviour. Chrome ignores that request which, they say, is a legitimate feature for security. For password fields, maybe (at a push: I still prefer actually using my brain to remember things), but all fields including name and address fields? That seems like a step too far, given that showing two popups arguably violates their mantra of helping to create a good UX for all. Why would a developer’s wishes not count when there is a legitimate user-centric reason to override the browser behaviour? What next, forbid me from disabling fields because it thinks they sound too important?

Anyone have any thoughts on how to work around it? Do I just send a feedback notice to Uncle Google and hope someone cares about the user experience? Asking visitors to change their autocomplete setting off for all sites, or starting their browser with the --disable-ignore-autocomplete-off flag, is not going to wash. Setting autocomplete="off" in the enclosing <form> tag is a supposed way to bypass it, but it’s not particularly helpful, as it means no other fields like phone numbers and name would be auto-filled; and that’s quite handy for users.

After contacting Capture+ themselves, they suggest using a different value for the autocomplete attribute which, presumably either Google don’t check for, or the Capture+ system intercepts and returns a false that prevents the browser from getting a look-in. It seems to work, but it isn’t valid markup.

Bah.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2015-05-13 11:40:17

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,730
Website

Re: Google Chrome and autocomplete=off violation

Have you tried: autocomplete="false" instead of ‘off’? Some people have reported that works where off doesn’t. There are a few more js-based hacks in this thread too, including deceiving chrome by providing a prefixed placeholder/value text, zeroing its value or even swapping out it’s name on focus, so that chrome doesn’t know what to suggest…


TXP Builders – finely-crafted code, design and txp

Online

#3 2015-05-13 11:55:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: Google Chrome and autocomplete=off violation

jakob wrote #290723:

Have you tried: autocomplete="false" instead of ‘off’?

Must admit not, will give it a go thanks.

deceiving chrome by providing a prefixed placeholder/value text, zeroing its value or even swapping out it’s name on focus, so that chrome doesn’t know what to suggest

All very good suggestions. Tried the ‘hidden field with the same name’ trick but it felt dirty.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2015-05-14 13:53:13

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,196
Website

Re: Google Chrome and autocomplete=off violation

Stef, not sure if this will affect you, but this caught my attention in the Firefox 38 release notes (released today):

autocomplete=off is no longer supported for username/password fields

PS – Personally I’d be quite annoyed (ahem p***ed off) if a store broke my address autocomplete.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#5 2015-05-14 14:33:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: Google Chrome and autocomplete=off violation

phiw13 wrote #290771:

Firefox 38 release notes

Interesting, thanks for the heads up. Looks like Firefox are doing it “right”: only ignoring autocomplete on username / passwords to encourage people to let their browsers remember longer ones. Regardless that’s completely against my policy and anything I advise, but that’s just me.

PS – Personally I’d be quite annoyed (ahem p***ed off) if a store broke my address autocomplete.

Yeah, well that was the thing. We’re trying to help out new users by allowing them to bypass the:

  • Enter postcode
  • Click button
  • Wait for popup
  • Scroll to address
  • Hit OK

dance. But also still allow autocomplete for people that have it from other (non-address) fields. Being able to just tab down to any address field (address, city, state, postcode, etc) and start typing your address to then have a live list filtered directly in that box is pretty handy. You simply hit Enter on the correct one from the filtered list and the entire address gets inserted straight away in all other address-type boxes.

Google thwarts that to some extent because the multiple popups interfere with one another.

The thing is, the form fields are in the usual order:

  • First name
  • Last name
  • Email
  • Address line 1
  • Address line 2

Your cursor starts in the first box so if you start typing your first name, Chrome will auto-complete the rest of the form for you straight away anyway. You can then bypass all the address fields entirely, job done. The problem comes when you tab through the form to get to the end, and see two popups every time you hit a field that’s part of an address. We want to avoid that if possible because it’s ugly and confusing. Perhaps there’s some jQuery we can use to NOT show the Capture+ popup on tab, only if the field is edited. We’re kind of reliant on their scripts though :-(

It’d be nice to just turn off auto-complete on all address fields (possibly bar the postcode), thus still permitting autofill from name / email / postcode fields but deferring to Capture+ if you drop your cursor into the other address boxes.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2015-05-15 07:43:02

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: Google Chrome and autocomplete=off violation

I think that this might be of help.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB