Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Name name attribute wrong value assigned #2416

Closed
PiyushAgrawal1243 opened this issue Jan 25, 2023 · 10 comments
Closed

First Name name attribute wrong value assigned #2416

PiyushAgrawal1243 opened this issue Jan 25, 2023 · 10 comments
Labels
Content:HTML issues related to HTML examples. idle Issues and pull requests with no activity for three months.

Comments

@PiyushAgrawal1243
Copy link

PiyushAgrawal1243 commented Jan 25, 2023

MDN URL

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

What specific section or headline is this issue about?

HTML Demo content first name name attribute wrong value assiged

What information was incorrect, unhelpful, or incomplete?

First Name name attribute value "firstName" is wrong ,for fix this issue we need to assign "firstname" to name attribute then it will work.

I have added 2 images first with name attribute with "firstname" that suggesting us a option second image with name attribute with "firstName" that didn't suggesting us a option.

Due to name attribute value autocomplete attribute is able to identify the fields and auto complete the field value.

check below images.
Screenshot from 2023-01-25 12-34-39
Screenshot from 2023-01-25 12-34-29

What did you expect to see?

Screenshot from 2023-01-25 12-34-39

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@PiyushAgrawal1243 PiyushAgrawal1243 added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jan 25, 2023
@github-actions github-actions bot added the Content:HTML issues related to HTML examples. label Jan 25, 2023
@bsmth bsmth transferred this issue from mdn/content Jan 26, 2023
@github-actions
Copy link

It looks like this is your first issue. Welcome! 👋 One of the project maintainers will be with you as soon as possible. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct.

@bsmth
Copy link
Member

bsmth commented Jan 26, 2023

Moving this over as it looks like the example is here: https://github.com/mdn/interactive-examples/blob/main/live-examples/html-examples/form-attributes/attribute-autocomplete.html

Although I'm not sure what the issue is. In the first screenshot you are changing firstName to firstname and I'm not sure this makes a difference, have I misread the issue?

@NiedziolkaMichal
Copy link
Member

Both ways of writing firstName in name attribute are correct. Browsers are building auto-completion results, based on previous usages of input elements with the same case-sensitive name. There are many suggestions over the internet to use either of those forms and for me, auto-completion works on both of them.

@PiyushAgrawal1243
Copy link
Author

Both ways of writing firstName in name attribute are correct. Browsers are building auto-completion results, based on previous usages of input elements with the same case-sensitive name. There are many suggestions over the internet to use either of those forms and for me, auto-completion works on both of them.

If that so then why name="firstName" not working for me in example and name="firstname" working in example.

For reference you can check above images.

I tried both ways in my project but name="firstname" work for me.

@NiedziolkaMichal
Copy link
Member

You can use the following guide, to find out the exact information held by the Chrome browser, used in autofill suggestions: https://superuser.com/questions/884029/see-all-autofill-data.
Those values are present in my case:
image

As you can see, first-name, first_name, firstname, and firstName keys are used, and the value displayed to the user depends on the name attribute value.
In your case, the browser holds just firstName keys while it doesn't have anything for firstname, because other websites you have visited, use lowercase names.

I really don't know if we should use firstName or firstname in our example, as I couldn't find any official guidance about it. If someone knows more about this subject, I would be happy to find out.

@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label Mar 2, 2023
@CBID2
Copy link
Contributor

CBID2 commented Jun 19, 2023

You can use the following guide, to find out the exact information held by the Chrome browser, used in autofill suggestions: https://superuser.com/questions/884029/see-all-autofill-data. Those values are present in my case: image

As you can see, first-name, first_name, firstname, and firstName keys are used, and the value displayed to the user depends on the name attribute value. In your case, the browser holds just firstName keys while it doesn't have anything for firstname, because other websites you have visited, use lowercase names.

I really don't know if we should use firstName or firstname in our example, as I couldn't find any official guidance about it. If someone knows more about this subject, I would be happy to find out.

Hey @NiedziolkaMichal! According to W3, HTML attribute names may be written with any mix of lower- and uppercase letters that, when converted to all-lowercase, matches the attribute's name; attribute names are case-insensitive, so you’re onto something.

@github-actions github-actions bot removed the idle Issues and pull requests with no activity for three months. label Jun 20, 2023
@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label Jul 21, 2023
@estelle
Copy link
Member

estelle commented Jul 28, 2023

The example was missing the id attribute, which has since been fixed.
it is missing the <form> and submit button, which the text advises may be needed. Not sure if that is the issue.

The relevant spec is:

https://html.spec.whatwg.org/#autofilling-form-controls:-the-autocomplete-attribute

the autocomplete attribute, if specified, must have a value that is an ordered set of space-separated tokens consisting of either a single token that is an ASCII case-insensitive match for the string "off", or a single token that is an ASCII case-insensitive match for the string "on", or autofill detail tokens.

@CBID2
Copy link
Contributor

CBID2 commented Jul 29, 2023

The example was missing the id attribute, which has since been fixed.

it is missing the <form> and submit button, which the text advises may be needed. Not sure if that is the issue.

The relevant spec is:

https://html.spec.whatwg.org/#autofilling-form-controls:-the-autocomplete-attribute

the autocomplete attribute, if specified, must have a value that is an ordered set of space-separated tokens consisting of either a single token that is an ASCII case-insensitive match for the string "off", or a single token that is an ASCII case-insensitive match for the string "on", or autofill detail tokens.

Maybe I can add those components to see if this solves the issue @estelle.

@estelle
Copy link
Member

estelle commented Jul 29, 2023

it works for me in Edge already. I am not sure if this is actually resolved or if there is still an issue.

@github-actions github-actions bot removed the idle Issues and pull requests with no activity for three months. label Jul 29, 2023
@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label Aug 29, 2023
@caugner
Copy link
Contributor

caugner commented Sep 28, 2023

As @estelle already pointed out, the example has been fixed (in #2530).

@caugner caugner closed this as completed Sep 28, 2023
@caugner caugner removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML issues related to HTML examples. idle Issues and pull requests with no activity for three months.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants