Google Chrome Ignoring Autocomplete

Google Icons

While working on a Drupal Commerce project, I came across an interesting issue during checkout. My client’s coupon field keeps getting populated with a user’s country when they use autofill to fill out their address.

Upon working through disabling the autofill or autocomplete feature on the coupon field, the new version of Google’s browser Google Chrome ignores the autocomplete=off setting.

The solution to this problem was to update the autocomplete attribute with a string other than ‘off.’

Correct way, but ignored by Google:

<input type="text" name="commerce_coupon" autocomplete="off">

Updated way to work with the latest Google Chrome:

<input type="text" name="commerce_coupon" autocomplete="new-string">

Original Post:

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.