【发布时间】:2021-10-21 00:24:21
【问题描述】:
在具有多个电子邮件输入且名称、ID 和占位符不同的表单中,chrome 一次始终自动填充 9 个字段。当然,我可以禁用自动填充(使用autocomplete="new-password"),这样就解决了问题。
但是我该怎么做,用户可以从他的自动填充中选择多个不同的电子邮件?
<form action="">
<input type="email" name="email1" id="mail-1" placeholder="Mail of Person #1">
<input type="email" name="email2" id="mail-2" placeholder="Mail of Person #2">
<input type="email" name="email3" id="mail-3" placeholder="Mail of Person #3">
<input type="email" name="email4" id="mail-4" placeholder="Mail of Person #4">
<input type="email" name="email5" id="mail-5" placeholder="Mail of Person #5">
<input type="email" name="email6" id="mail-6" placeholder="Mail of Person #6">
<input type="email" name="email7" id="mail-7" placeholder="Mail of Person #7">
<input type="email" name="email8" id="mail-8" placeholder="Mail of Person #8">
<input type="email" name="email9" id="mail-9" placeholder="Mail of Person #9">
<input type="email" name="email10" id="mail-10" placeholder="Mail of Person #10">
</form>
演示:https://jsfiddle.net/xhtv781s/ 带数组命名的演示:https://jsfiddle.net/1kuvfasq/
在 macOS 10.15.7 / Chrome 92 上测试。
【问题讨论】:
-
我在所有浏览器中都禁用了自动填充,所以我不得不问:所有自动填充字段中的电子邮件地址是否相同?
-
我不认为你想要做的事情是可能的。
-
@DavidsaysreinstateMonica 是的 - 都一样,检查屏幕 gif
标签: html google-chrome input autofill