Chrome ignores autocomplete=“off”

后端 未结 30 1503
礼貌的吻别
礼貌的吻别 2020-11-22 00:42

I\'ve created a web application which uses a tagbox drop down. This works great in all browsers except Chrome browser (Version 21.0.1180.89).

Despite both the

30条回答
  •  爱一瞬间的悲伤
    2020-11-22 01:19

    i found this solution to be the most appropriate:

    function clearChromeAutocomplete()
    {
    // not possible, let's try: 
    if (navigator.userAgent.toLowerCase().indexOf('chrome') >= 0) 
    {
    document.getElementById('adminForm').setAttribute('autocomplete', 'off'); 
    setTimeout(function () {
            document.getElementById('adminForm').setAttribute('autocomplete', 'on'); 
    }, 1500);
    }
    }
    

    It must be loaded after dom ready, or after the form renders.

提交回复
热议问题