[英]iOS Safari (iPhone SE) auto complete not working HTML5 autocomplete attributes added
We have a web form, and using the tips from iOS Safari Autofill / autocomplete sections not working however the current iOS doesn't work on the codepen here: https://codepen.io/grigs/pen/YqoyWv
是否有任何明确的方法可以自动完成 iOS Safari?
示例输入字段是:
<div class="form-group">
<label class="font-weight-bold input-label" for="FirstName">First name * <span class="field-validation-valid field-validation-valid" data-valmsg-for="FirstName" data-valmsg-replace="true"></span></label>
<input type="text" class="form-control input input-about-you" data-val="true" data-val-required="Please enter your first name(s)" autocomplete="given-name" id="FirstName" name="FirstName" value="">
</div>
所有其他浏览器都尊重 HTML5 自动完成提示,除了 iOS Safari 似乎 - 所以让它工作会很棒。
我们正在苦苦挣扎的确切手机是 iPhone SE MX9R2B/A - 所以是 iPhone SE 2020。我确信它可能会影响其他 iOS 和 Safari。
codepen 示例似乎是正确的,我刚刚在iPhone SE 2nd generation - iOS14.4
Emulator 上进行了测试
您可能缺少的技巧是在 Safari 移动设备上启用AutoFill
来执行此操作 go 到: Settings > AutoFill > toggle Use contact info/Credit Cards
(如果需要)
您也可以参考本指南Safari 的奇怪行为,它来自 2016 年,但其中解释了很多自动填充行为。
你做错了。 这是 HTML5 自动完成的正确方法
<form autocomplete="on">
<label for="fname">First Name:</label>
<input type="text" id="firstname" name="firstname">
</form>
希望这个答案对您有所帮助。
了解有关自动完成的更多信息: https://www.w3schools.com/tags/att_input_autocomplete.asp
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.