You are here

function password_policy_constraint_length_js in Password Policy 7

Same name and namespace in other branches
  1. 6 constraints/constraint_length.inc \password_policy_constraint_length_js()

Javascript portion.

File

constraints/constraint_length.inc, line 37
Password policy constraint callbacks.

Code

function password_policy_constraint_length_js($constraint, $account) {
  return <<<JS

    if (!value.length || value.length < {<span class="php-variable">$constraint</span>}) {
      strength = 'low';
      msg.push(translate.constraint_length);
    }
JS;
}