2

I have the following jquery select2 input:

<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">

When I click on this in chrome, google does an autofill for a phone number and the field is for industry type.

I tried everything here Stop Google chrome auto fill the input and it seems that the latest update to chrome blocks all attempts to stop autofill.

How can I either remove the autofill or disassociate with phone numbers?

Atma
  • 29,141
  • 56
  • 198
  • 299
  • You can try adding a script like this at document ready function document.getElementById("myText").autocomplete = "off"; – Utkarsh Bais May 30 '18 at 20:22

1 Answers1

-1

Solution:

$('#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');
        }
    })