html - Safari 自动填充信用卡

标签 html autocomplete safari autofill

我正在尝试使用下面的代码来使用信用卡的“Safari 自动填充”。 但是没有用

<input type="text" autocomplete="cc-number">
<input type="text" autocomplete="cc-name">
<input type="text" autocomplete="cc-exp-month">
<input type="text" autocomplete="cc-exp-year">
<input type="text" autocomplete="cc-csc">

最佳答案

要使其正常工作,您需要:

  • 使用以下任意名称:addCreditCardNumber、cardNumber、cardnumber - 或- 任意以下 id:cardNumber、creditCardNumber、creditCardMonth、creditCardYear(可能还有更多有效的 id 或名称)
  • 使用文本类型(而非数字类型)的输入
  • 最重要的是它只能在 https 上工作

希望这对您有所帮助!

关于html - Safari 自动填充信用卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21885412/

相关文章:

file-io - 如何阻止自动完成覆盖具有类似名称的文件

asp.net - Windows Safari的ASP.NET表单例份验证

javascript - Safari 6.1/7.0 中 iframe/mousewheel 错误的解决方法

javascript - JQuery/CSS 父子继承 NIGHTMARE

php - 如何在 Yii 中使用 CListView 自定义 dataProvider

html - 3列表,宽度: auto, 50%、50%,溢出隐藏

java - 函数参数错误 - JComboBox 中的 AutoComplete

javascript - 如何从另一个 iFrame 中清除 iFrame 的内容

cocoa - NSTokenField 建议但未完成

html - Flex/Grid 布局不适用于按钮或字段集元素