Skip to content

bookercodes/compareTo

Repository files navigation

CompareTo is a custom HTML5 attribute that compares two passwords with one another. If the passwords are not the same, a native error will be shown to the user:

You can see the demo here.

##Installation

  1. Download the minified script and reference it from your document; or,
  2. Reference the online minified script from your document. See the demo code if you need to.

##Usage

<form action="register" method="post">
  <input type="text" name="username" required>
  <input type="password" name="password" required>
  <input type="password" name="compare_password" compareTo="password" required>
</form>

##Custom validity error message

<form action="register" method="post">
  <input type="text" name="username" required>
  <input type="password" name="password" required>
  <input type="password" name="compare_password" compareTo="password" required>
  <input type="email" name="email" required>
  <input 
    type="email" 
    name="compare_email" 
    compareTo="email" 
    compareToError="emails do not match" 
    required>
</form>

##Support

Common problems will manifest in the developer console:

Still having trouble? Open an issue and someone will get back to you shortly 😄.

About

⚡ Custom HTML5 element attribute that compares two passwords. https://alexbooker.github.io/compareTo/

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published