【问题标题】:How to Have Google Not Show Recent Inputs如何让谷歌不显示最近的输入
【发布时间】:2017-10-17 23:40:36
【问题描述】:

所以,我有一个input 框,要求提供电子邮件地址。当我将电子邮件放入邮箱时,会发生以下情况:

正如我们在此处看到的,它显示了之前输入的电子邮件地址。我想知道是否/如何在所有用户的计算机上禁用此功能(不仅在我的)(因此它不仅是 chrome 设置,而且是 HTML 代码)。

【问题讨论】:

标签: html google-chrome input


【解决方案1】:

在 chrome 中禁用设置下的自动填充。 谷歌还将所有内容存储在帐户中。

【讨论】:

  • 我需要 Google 也为其他用户禁用它。
【解决方案2】:

在纯 HTML 中,这是不可能的,这是浏览器规则。有几种解决方案可用于绕过此规则。对于不应该填写的字段,我自己使用 jQuery。

这不是最漂亮的解决方案,但它对我有用。

 // function to disable auto form fill
    function disableAutofill(selector){
        if($(selector).val() == "")
            {
                $(selector).css("color","#99a6c4");
                $(selector).val($(selector).attr("placeholder"));
            }
        $(selector).focusin(function() {
            if($(selector).val() === $(selector).attr("placeholder"))
            $(selector).val('');
        });
    }
    // call autofill function for input element
    disableAutofill("#inputEmail");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 2012-07-25
    • 2012-04-05
    • 1970-01-01
    • 2019-03-27
    • 2021-03-20
    相关资源
    最近更新 更多