【问题标题】:google chrome is adding autofill phone number over a text dropdown not related to phone number谷歌浏览器在与电话号码无关的文本下拉列表中添加自动填充电话号码
【发布时间】:2018-05-30 17:31:53
【问题描述】:

我有以下 jquery select2 输入:

<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" id="s2id_autogen2" placeholder="" style="width: 34px;" aria-activedescendant="select2-result-label-81">

当我在 chrome 中单击此选项时,谷歌会自动填充电话号码,该字段用于行业类型。

我在这里Stop Google chrome auto fill the input 尝试了一切,似乎最新的 chrome 更新阻止了所有停止自动填充的尝试。

如何删除自动填充或取消与电话号码的关联?

【问题讨论】:

  • 您可以尝试在文档就绪函数 document.getElementById("myText").autocomplete = "off"; 中添加这样的脚本

标签: jquery html google-chrome jquery-select2


【解决方案1】:

解决方案:

$('#Name').on('mouseup keyup', function () {
        var val = $('#Name').val();
        val = val.length;
        if (val === 0) {
            $('#Name').attr('autocomplete', 'on');
        }
        else {
            $('#Name').attr('autocomplete', 'new-password');
        }
    }).on('mousedown keydown', function () {
        var val = $('#Name').val();
        var length = val.length;
        if (!length) {
            $('#Name').attr('autocomplete', 'new-password');
        }
    })

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-29
    • 1970-01-01
    • 2013-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多