自动完成“关闭"被完全忽略 [英] Autocomplete "Off" is completely ignored

查看:82
本文介绍了自动完成“关闭"被完全忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我知道这个autocomplete ="off"标签应该如何在除密码字段之外的所有输入上工作,我已经搜索了针对我的特定问题的答案,但看起来我是唯一一个与此相关的人问题.我知道我可以将其添加到表单元素或单个输入元素中.我的文档类型设置为:<!DOCTYPE html>.

Okay, so I know how this autocomplete="off" tag is supposed to work on all inputs except a password field and I have searched for an answer to my specific problem but it looks like I'm the only one with this problem. I know I can add it to the form element or to an individual input-element. My doctype is set as: <!DOCTYPE html>.

我有一个包含2个问题的表格(此示例已简化):姓名和电话.为了进行测试,我将autocomplete ="off"添加到了两个字段和form元素中.

I have a form with 2 questions (simplified for this example): Name and Phone. For testing purposes I have added the autocomplete="off" to both fields AND the form element.

这是我的表格:

<form id="myform" autocomplete="off">
    <input autocomplete="off" type="text" name="name" />
    <input autocomplete="off" type="text" name="phone" />
</form>

表格完全忽略了autocomplete ="off",并提示了我的姓名和电话号码.

The form totally ignores the autocomplete="off" and suggests my name and phone number.

有人有什么主意吗?

推荐答案

伙计们,解决方案实际上很简单:

autocomplete="__away"

我们所做的是告诉所有浏览器完全忽略该字段,因为__away是空值-不存在.

What we have done is tell any browser to completely ignore the field since __away is an air value - does not exist.

这篇关于自动完成“关闭"被完全忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆