Developer Resources

Design your website to work best with 1Password

Learn how to make sure 1Password correctly fills forms and generates passwords on your website by following some simple guidelines.

1Password is designed to generate, fill, and save passwords on most websites. You shouldn’t have to do anything special to support 1Password on your website, as long as you develop your pages according to best practices. This will make the intention of each page element clear. 1Password will have an easier time understanding your page even when you make changes to it.

Build logical forms

If 1Password has trouble saving or filling on your site, make sure you’re following best practices with your forms:

  • Use unique element ids for every field.
  • Enclose <input> fields in <form> elements.
  • Group related fields (like usernames and passwords) together in the same <form> element.
  • Separate unrelated fields into different <form> elements. For example, put registration and sign-in fields in different forms.

Password change forms

To make the intention of each form element clear on password change forms, ask for the current password, the new password, and a password confirmation in that order.

Provide password requirements

1Password can generate passwords that fit your website’s password requirements. 1Password uses Apple’s Password Manager Resources to identify a website’s unique password rules along with the shared credential backends file in the same repository for multiple domains that share the same account system.

To provide the rules 1Password will use to generate smart passwords, add the following attributes to each <input type="password"> element:

  • passwordrules
  • minlength
  • maxlength

Learn how to create a passwordrules attribute.

Embrace accessibility

Making your website accessible benefits everyone who uses your website. As a bonus, making your site accessible provides clues to 1Password as well.

When examining a page, 1Password can take advantage of accessibility cues to locate fields:

  • Give every field a <label> element.

  • Use the for attribute on your labels to associate them with the appropriate field:

      <label for="username-field">Username</label>
      <input name="username" id="username-field">
  • Use ARIA attributes to annotate form fields. For example, use the aria-hidden attribute on fields that aren’t visible.

To improve reliability

Follow these additional guidelines to make sure 1Password will always work with your site, even when you make changes to it:

  • Use placeholder attributes on fields instead of overlays.
  • Don’t use generated field names and ids.
  • Don’t dynamically add or remove fields from the DOM. Reuse fields and hide them when you don’t need them.
  • Use autocomplete attributes on fields. They’re not required, but there may be fields 1Password can’t locate without them.

Get help

Make sure you’re testing with the latest 1Password beta release.

If you’re still having trouble after following the guidelines above, get help from the 1Password Support Community.

Still need help?

If this article didn't answer your question, contact 1Password Support.