1
我一直在試圖將密碼強度指示器實施到我在過去幾天工作的項目中,並決定使用Jquery.pwstrength。Jquery.pwstrength密碼強度指示器規則不起作用
UI工作正常,兩條規則正在工作,即wordSequences
和wordRepetitions
,但是沒有其他規則被強制執行,但都被激活並附加了分數。
這裏是我的代碼:
$(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中包含了正確的文件。