开发者

Standard names for HTML input fields

开发者 https://www.devze.com 2022-12-22 10:58 出处:网络
I\'ve tried searching for the answer to this question all kinds of ways but with no success. Is there a list of \"standard\" names for fields in an HTML form? For example, \"First Name\", \"Home Phon

I've tried searching for the answer to this question all kinds of ways but with no success.

Is there a list of "standard" names for fields in an HTML form? For example, "First Name", "Home Phone", etc. I suspect there's probably not an official standard but more of a loose convention. I am creating a form and if possible I'd开发者_如何学JAVA like it to play nicely with form fillers, accessibility software, etc.

What information do form fillers typically use to determine where to put a user's phone number or email address in a form?


See http://www.ietf.org/rfc/rfc3106.txt

Also some info about Google toolbar auto fill here http://www.google.com/support/forum/p/Toolbar/thread?tid=7ce6293ebaa69edb&hl=en

The above Google link is dead. Use these instead:

https://developers.google.com/web/updates/2015/06/checkout-faster-with-autofill

https://developers.google.com/web/fundamentals/design-and-ui/input/forms/


What information do form fillers typically use to determine where to put a user's phone number or email address in a form?

There is no widely applied standard I know of, and most sites pretty much do as they like. I think every automatic form filler has to have the ability to detect those fields intelligently, so I would say you can basically name them as you please.

You could, however, look at what other popular formats like vCard name their elements after. That's probably as close to a standard as you will get.


I would say no, but I'm sure the makers of form filling software have thought of this. As long as you keep your names relevant they should understand what you mean. Call them things like 'firstName' and not 'formFieldOne' and you should be fine.

Maybe you could have a look at the html of popular websites to see what they call their inputs?


Best practices, standards and guidelines, there is a huge difference between all of these and usually each can be take in a particular context. For example, fo this particular item, there is not standard, especially not a W3C standard in regards to form field naming, however, when taking into consideration items such as acessibility, e.g. Section 508, there are standards.

http://www.access-board.gov/sec508/guide/1194.22.htm

Granted, these are not around the names per sey of the fields themselves but rather how you would construct the label of the names to allow for consumable accessibility (screen readers).

What naming standards such as this come down to is that you should scope out requirements and do tests around usability/accessibility - for your organzation. This means you should name fields (labels and actual controls) in a way in which your organization can easily consume and understand them.

A simple example, at one organization the term 'address' may fly for street, in another it would be confusing and interpreted as the entire mail address.

0

精彩评论

暂无评论...
验证码 换一张
取 消