2016-05-08 14 views
1

私は過去数日間働いているプロジェクトにパスワード強度インジケータを実装しようとしていて、Jquery.pwstrengthを使用することに決めました。Jquery.pwstrengthパスワード強度インジケータのルールが機能しない

UIは正常に動作し、2つのルール、つまりwordSequenceswordRepetitionsが動作しますが、その他のルールは適用されていませんが、すべて有効になっており、スコアが付けられています。ここで

は私のコードです:

$(document).ready(function() { 
    options = { 
     common: { 
      minChar: 8, 
      debug: true 
     }, 
     ruleScores: { 
      wordLength: -100, 
      wordRepititions: -100, 
      wordLowercase: 1, 
      wordUppercase: 3, 
      wordOneNumber: 3, 
      wordThreeNumbers: 5, 
      wordOneSpecialChar: 3, 
      wordTwoSpecialChar: 5, 
      wordUpperLowerCombo: 2, 
      wordLetterNumberCombo: 2, 
      wordLetterNumberCharCombo: 2 
     }, 
     rules: { 
      wordSequences: true, 
      wordRepetitions: true, 
      wordLength: true, 
      wordLowercase: true, 
      wordUppercase: true, 
      wordOneNumber: true, 
      wordThreeNumbers: true, 
      wordOneSpecialChar: true, 
      wordTwoSpecialChar: true, 
      wordUpperLowerCombo: true, 
      wordLetterNumberCombo: true, 
      wordLetterNumberCharCombo: true 
     }, 
     ui: { 
      showPopover: true, 
      showErrors: true, 
      showProgressBar: true 
     } 
    }; 
    $('#password').pwstrength(options); 
}); 

そして、これは私が上のインジケータを使用しているHTMLページである:ここで起こっているのと

<div class="form-group"> 
    <form:label path="password" class="col-sm-2 control-label required">Password:</form:label> 
    <div class="col-sm-10"> 
     <c:if test="${not empty passwordRequired}"> 
      <form:input id="password" path="password" class="form-control" type="password" required="true" /> 
     </c:if> 
     <c:if test="${empty passwordRequired}"> 
      <form:input id="password" path="password" class="form-control" type="password" /> 
     </c:if> 
    </div> 
</div> 

任意のアイデア?私は正しいファイルをHTMLにも含めました。

答えて

0

正確なパッケージが分からないと、確信が持てません(名前にJquery.pwstrengthを持つパッケージが複数あります)。 https://github.com/ablanco/jquery.pwstrength.bootstrap/blob/master/OPTIONS.mdなどを使用しているようです。この場合、optionsオブジェクトが間違っている場合、を保持するオブジェクトはactivatedである必要があります。

関連する問題