1

I have created a simple form in HTML which has two fields: Username and Password, and then a Log in button. When I run the page in Chrome it fills the two fields with my XAMPP-phpmyadmin username and password into the fields and highlights them yellow. How can I completely remove this so they are blank. Thanks

HTML form code:

<html>


    <form action= "entryformlogon.php" method = "post" autocomplete="off">
            Username: <input type="text" name="Username"><br>
            Password: <input type="password" name="Password"><br>
                      <input type="submit" value="Log in">
    </form>


</html>
Charley Baker
  • 47
  • 1
  • 1
  • 6

3 Answers3

1

autocomplete= "off" must be added to every input element. i.e.

<input type="text" name="Username" autocomplete="off">
Alex Hill
  • 713
  • 1
  • 5
  • 13
  • I just tried, look at: http://jsfiddle.net/yq3t5b9p/ when run in jsfiddle the forms are blank however when run in chrome the problem is still occuring – Charley Baker Oct 21 '14 at 21:58
  • It seems a decent workaround is here http://stackoverflow.com/questions/15738259/disabling-chrome-autofill – Alex Hill Oct 21 '14 at 22:00
0

Chrome it fills the two fields with my XAMPP-phpmyadmin username and password into the fields and highlights them yellow. How can I completely remove this so they are blank. @Charley Baker

This readonly-fix worked for me:

fix browser autofill in: readonly and set writeble on focus (at mouse click and tabbing through fields)

 <input type="password" readonly  
     onfocus="$(this).removeAttr('readonly');"/>

By the way, some more information on Chrome and Safari auto fill behaviour:

Sometimes even autocomplete=off would not prevent to fill in credentials into wrong fields, but not user or nickname field. I guess, the Chrome and Safari look for a password field to insert your saved credentials. Then it autofills username into the nearest textlike-input field , that appears prior the password field in DOM (just guessing due to observation). As the browser is the last instance and you can not directly control it, but the read-only trick above fixes it. :-)

dsuess
  • 5,219
  • 2
  • 22
  • 22
0

For latest version of chrome

<input type="password" name="whatever" autocomplete="new-password" />

older version

<input type="password" name="whatever" autocomplete="false" />

or

<input type="password" name="whatever" autocomplete="off" />
S.Maina
  • 11
  • 2