1
votes

I have a password field and used autocomplete="off" for disabling the browser save password popup.But it doesn't works. Then I tried using as input type "text" and used CSS to make the entered text as password using "-ms-text-security: disc:;".It does not work in Edge.

<input type="text"  style ="-ms-text-security: disc;"/>

I have also used "-webkit-text-security: disc; " instead of "-ms-text-security: disc:;"and worked on chrome but not on Edge.

1

1 Answers

0
votes

Try to add line of code below in your HTML input will help you to disable save password browser popup.

readonly onfocus="this.removeAttribute('readonly');" autocomplete="off" 

Example code:

<!DOCTYPE html>
<html>
<head>
	<title>Login Form</title>
</head>
<body>

<form action="">
  

  <div class="container">
    <label for="uname"><b>Username :</b></label>
    <input type="text" placeholder="Enter Username" name="uname"  readonly 
    onfocus="this.removeAttribute('readonly');" autocomplete="off" ><br>

    <label for="psw"><b>Password : </b></label>
    <input type="password" placeholder="Enter Password" name="psw" readonly 
    onfocus="this.removeAttribute('readonly');" autocomplete="off" ><br>

    <button type="submit">Login</button><br>
   
</form>

</body>
</html>