Define minimum lenght in KTPasswordMeter

Hi,

When I use the Metronic's KTPasswordMeter class it asks for a password of a minimum of 8 characters. ("Use 8 or more characters with a mix of letters, numbers & symbols."

How can I change the minimum rerquirement to 12 or mor characters?

I checked the Password Meter api documentation and I cannot find any way to do it.

thanks!

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)

Hi,

To initialize a Password Meter with custom options please use the below JS code:

var options = {
minLength: 8,
checkUppercase: true,
checkLowercase: true,
checkDigit: true,
checkChar: true,
scoreHighlightClass: "active"
};
var passwordMeterElement = document.querySelector("#kt_password_meter_control");
var passwordMeter = new KTPasswordMeter(passwordMeterElement, options);

To cancel the auto initialization of the password meter instance please remove data-kt-password-meter="true" attribute to avoid lazy initializes.

Regards.

That is exactly what I need. Thank you for detailed answer!

Glad to help you out. If you need any further clarifications please do let me know happy

Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.
Deleted comment
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(