Reputation: 11
How can I turn Off Autocomplete for password input fields in a html form.
autocomplete="false"
or
autocomplete="off"
.Upvotes: 0
Views: 1268
Reputation: 560
to hide your saved password or any text input that is saved make your input "readonly" and change "onfocus" like this.
<input readonly onfocus="this.removeAttribute('readonly');" autocomplete="off" type="password">
Upvotes: 2
Reputation: 11
Browser first fill username than fill password.This code worked for me :D
$('#gsmloginnum').on('input', function() {
$('#gsmPassword').prop("readonly", true);
$( "#gsmPassword").css("border-color", "#fff");
});
$( "#gsmPassword" ).focus(function() {
$( "#gsmPassword").removeAttr("readonly");
});
Upvotes: 0