【问题标题】:HTML form autocomplete address semanticsHTML 表单自动完成地址语义
【发布时间】:2017-09-10 18:23:46
【问题描述】:

我正在编写一份注册表,该注册表在提交时需要家庭和工作地址。 字段如下:

<html>
  <form>
    <input name="street-address" autocomplete="home street-address" required />
    <input name="postal-code" autocomplete="home postal-code" required />
    <input name="locality" autocomplete="home locality" required /> <!-- or "home city" -->

    <input name="organization" autocomplete="organization" required />
    <!-- addressee or department withing the organization. optional field -->
    <input name="addressee" autocomplete="????????" />
    <input name="work-street-address" autocomplete="work street-address" required />
    <input name="work-postal-code" autocomplete="work postal-code" required />
    <input name="work-locality" autocomplete="work locality" required />
  </form>
</html>

我正在使用http://microformats.org/wiki/hcardhttps://html.spec.whatwg.org/multipage/forms.html#attr-fe-autocomplete-organization-title 创建一个漂亮的浏览器兼容的自动填充表单。

我想不通的是,收件人/部门字段是否有一个不错的自动填充名称。 有人熟悉这个/或任何输入吗?

【问题讨论】:

    标签: html autofill vcf-vcard hcard


    【解决方案1】:

    我假设您想使用完整的street-address。如果您只想使用地址行 1,请尝试 address-line1

    MDN Specification here

    还有Google Developers page(注意:在此示例中您可以看到locality, ...,但它们已被弃用。使用)

    【讨论】:

      猜你喜欢
      • 2013-10-24
      • 2013-03-27
      • 2019-12-22
      • 2019-06-09
      • 2020-09-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-13
      相关资源
      最近更新 更多