2015-09-04 58 views
1

在Chrome瀏覽器中,如果我在登錄時爲網站保存了用戶名和密碼,那麼在整個網站中找到UsernamePassword字段,那些字段爲空,然後按默認它爲這些字段分配已保存的用戶名和密碼。文本框(用戶名,密碼)用鉻自動填寫

我試着用自動完成=「關閉」,並重新命名這些字段名稱爲txtUN,而不是txtUserNametxtPass,而不是txtPassword,但沒有奏效。 enter image description here

那麼如何防止自動填寫用戶名和密碼字段呢?誰能幫忙?

感謝

+0

自動完成=」。關閉'不工作了。在那裏查看帖子http://stackoverflow.com/questions/15738259/disabling-chrome-autofill –

+0

是的,在現代瀏覽器自動完成不再支持,但我仍然試圖:) – Chitta

回答

0

嘗試在谷歌/ Gmail帳戶註銷並relogging以獲取自動填寫其他檢查偏好您的隱私設置的選項。

2

檢查邁克·納爾遜本文

Disabling Chrome Autofill

更新的解決方案

現在,Chrome忽略了答案。因此,我原來的解決方法(我已刪除)現在是所有的憤怒。

只需創建幾個字段,並用「display:none」隱藏它們。例如:

<!-- fake fields are a workaround for chrome autofill getting the wrong fields --> 
<input style="display:none" type="text" name="fakeusernameremembered"/> 
<input style="display:none" type="password" name="fakepasswordremembered"/> 
-1

$(文件)。就緒(函數(){ 調試

 $('input[autocomplete="off"]').each(function() { 
      debugger 
      var input = this; 
      var name = $(input).attr('name'); 
      var id = $(input).attr('id'); 

      $(input).removeAttr('name'); 
      $(input).removeAttr('id'); 

      setTimeout(function() { 
       debugger 
       $(input).attr('name', name); 
       $(input).attr('id', id); 
      }, 1); 
     }); 
    }); 

這個PUT自動完成= 「關閉」 爲您想每個字段之前

相關問題