Disable browser 'Save Password' functionality

前端 未结 30 3681
失恋的感觉
失恋的感觉 2020-11-21 23:29

One of the joys of working for a government healthcare agency is having to deal with all of the paranoia around dealing with PHI (Protected Health Information). Don\'t get m

30条回答
  •  一整个雨季
    2020-11-21 23:44

    What I have been doing is a combination of autocomplete="off" and clearing password fields using a javascript / jQuery.

    jQuery Example:

    $(function() { 
        $('#PasswordEdit').attr("autocomplete", "off");
        setTimeout('$("#PasswordEdit").val("");', 50); 
    });
    

    By using setTimeout() you can wait for the browser to complete the field before you clear it, otherwise the browser will always autocomplete after you've clear the field.

提交回复
热议问题