Skip to content

Commit

Permalink
Prevent browser autocomplete problems
Browse files Browse the repository at this point in the history
- It seems some browsers (Chrome and possibly others) will insert the
  credit card expiration month from autofill into the quantity input
  box, instead of the CC month.
- This causes the item's quantity to be set to "06" or whatever the CC
  expiry month was in autofill, causing all-around customer confusion!
- See:
  http://stackoverflow.com/questions/39937170/prevent-chrome-from-autofilling-creditcard-info
- To fix, we use an invalid value of autocomplete="nope" to prevent
  browsers from trying to autocomplete here, which some do even when
  autocomplete="off"
- With this, Chrome properly inserts the autofill into the CC month
  field.
- It's possible we could name our CC fields differently, per:
  https://developers.google.com/web/updates/2015/06/checkout-faster-with-autofill
  but at the moment, this fixes it.
  • Loading branch information
jlav1n committed Nov 22, 2016
1 parent 0f0d8fa commit f8c6b3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dist/strap/include/checkout/shopping_cart
Expand Up @@ -42,7 +42,7 @@
[/if-item-field]
</td>
<td>
<input type="[if config FractionalItems]text[else]number[/else][/if]" name="[item-quantity-name]" value="[item-quantity]" class="form-control">
<input type="[if config FractionalItems]text[else]number[/else][/if]" name="[item-quantity-name]" value="[item-quantity]" class="form-control" autocomplete="nope">
</td>
<td style="text-align:right">
[item-discount-price]
Expand Down

0 comments on commit f8c6b3e

Please sign in to comment.