11

I have noticed on some websites google is asking me if i want to use a password generated by Chrome.

It doesnt happen with my own input field.

How can i make this work?

EXAMPLE

Karl Peterson
  • 111
  • 1
  • 3

1 Answers1

10

Based on chromium; this should work : (the suggest password comes after already known passwords for that site)

<form id="login" action="signup.php" method="post">
  <input type="text" autocomplete="username">
  <input type="password" autocomplete="new-password">
  <input type="password" autocomplete="new-password">
  <input type="submit" value="Sign Up!">
</form>

more examples : https://www.chromium.org/developers/design-documents/form-styles-that-chromium-understands

SvennD
  • 371
  • 5
  • 12
  • Can we trigger that password suggestion box using javascript ? – Mayur Kukadiya Jun 02 '21 at 05:55
  • 1
    You -most likely- cannot do that and I would suggest against using javascript to call on this functionality, if the browser decides its a bad idea to show password functionality there might be a good reason. – SvennD Jun 02 '21 at 14:18
  • I just want to show suggested password. Not user's saved password. So that user just click on it without manually typing password. If it is possible via javascript, then please help me. – Mayur Kukadiya Jun 03 '21 at 09:47