HTML 表单字段的标准名称

问题描述 投票:0回答:1

HTML 表单中的字段是否有“标准”名称列表?例如,名字与全名、家庭电话等。如果没有官方 W3C 或其他列表,是否有适用于所有自动填充应用程序的列表?

之前已在此处此处询问过此问题。然而,那里的答案已经有 10 多年的历史了,而且大多数链接都已经失效了。

html forms autofill
1个回答
0
投票

HTML 表单中的字段是否有“标准”名称列表?

不,没有。

或者例如,名字与全名、家庭电话等。是否有适用于所有自动填充应用程序的列表?

您询问的是

autocomplete=""
元素上的
<input />
属性。 是的HTML Living Standard 规范中有一个列表

截至 2023 年 10 月,列表为:

"name"
"honorific-prefix"
"given-name"
"additional-name"
"family-name"
"honorific-suffix"
"nickname"
"username"
"new-password"
"current-password"
"one-time-code"
"organization-title"
"organization"
"street-address"
"address-line1"
"address-line2"
"address-line3"
"address-level4"
"address-level3"
"address-level2"
"address-level1"
"country"
"country-name"
"postal-code"
"cc-name"
"cc-given-name"
"cc-additional-name"
"cc-family-name"
"cc-number"
"cc-exp"
"cc-exp-month"
"cc-exp-year"
"cc-csc"
"cc-type"
"transaction-currency"
"transaction-amount"
"language"
"bday"
"bday-day"
"bday-month"
"bday-year"
"sex"
"url"
"photo"

此外,地址字段的

autocomplete
可以选择添加
billing
shipping
前缀。

对于

<input type="tel" />
,值
home
work
mobile
fax
pager

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.