Custom demo

Registration

Password confirmation with a custom same-as rule and custom error copy.

Back to demo gallery

Developer notes

The confirmation field opts into a custom rule and the validator supplies the product-specific message.

Cross-field rule

<input
  id="confirm-password"
  name="confirmPassword"
  type="password"
  required
  data-validate="same-as"
  data-same-as="#password"
/>

Custom message

new A11yFormValidator(form, {
  ...createDefaultPreset(),
  messages: {
    sameAs: "Use the same password in both fields."
  }
});