HTML Doubt Credit Card Form

Asked

Viewed 400 times

2

I saw a form that suggests the credit card that’s on autocomplete. But I honestly don’t understand what’s different about this form autocomplete work?

If the fields input of form have not type how it is identified that it is a form to put the card data?

inserir a descrição da imagem aqui

Because the form Below it works by opening the credit card pages? How does it work?

Follows the code:

<form>
  <input placeholder="Card Number"/>
  <input placeholder="MM / YY" />
  <input placeholder="CVC"  />
</form>

  • Does this happen to this form on any domain? I don’t have an autocomplete card to test.

  • @bfavaretto I can’t explain, I’ve already made purchases with card on my pc, and this simple way there is enough to try to make the autocomplete, I just don’t know how to define it... Look how it is https://imgur.com/HXXn04B and went with the

  • I’m guessing he (browser? plugin?) does this based on the placeholder text.

  • I changed and still opened ... http://prntscr.com/pqt2f6 I can not say pq... In Firefox where I never bought with card did not open tb

  • What if the placeholder doesn’t give any hints, even in pt? I don’t know, tests with "guava with cheese".

  • It is quite possible that this is part of the system you are using. Credit card information is loaded based on the logged in user and a JS algorithm detects the capo based on date-attributes or Aria roles, to display the popup. I don’t know a native feature for HTML5 credit card

  • @Wesleyaraujo I suspect that it is a deployment of the same browser, and not of HTML, because I still can not understand how it makes the autocomplete based on the place Holder, until pq here is another model that the placeholder is 0000 and even so he finds the card! https://codepen.io/jeanoliveira/pen/XRZyVr test ai

  • @bfavaretto take a look at this, 2016 article https://cloudfour.com/thinks/autofill-what-web-devs-should-know-but-dont/ I’m even thinking about a conspiracy theory here haha, this "where to click buy" thingGoogle Pay, I think the industry has a lot to gain by facilitating impulse buying. I just don’t understand how to control this type of form, only the placeholder hasn’t convinced me yet, must have a technical explanation

  • 1

    @hugocsl It really must be something from the browser, and possibly from Chrome, (I haven’t tested in other browser). Well, I found this article that matches with your (and now ours) curiosity checkout-Faster-with-Autofill

  • It may be that it simply suggests in the first field if it is not of known type. My password manager does this sometimes.

  • @Wesleyaraujo was worth the tip I’ll read it calmly

Show 6 more comments

1 answer

-3

This is your browser’s cache, it tries to apply the autocomplete in the form fields in various ways, usually from priority to field id (so it is important to add id in all fields, facilitates filling based on previous uses)but the browser tries to guess what the field is about by label content, placeholder, etc...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.