![](/img/trans.png)
[英]Bootstrap 3.0 + jQuery Password Strength Meter for multiple password field
[英]jQuery Bootstrap Password Meter is not working
我正在嘗試為Twitter Bootstrap使用jQuery插件,該插件提供規則集以直觀地顯示用戶鍵入的密碼的質量。
但是我的問題是,當我嘗試在項目中使用它時,它似乎無法正常工作。 相應地顯示文本,但儀表欄不起作用。
這是我的HTML-
<form class="form-horizontal">
<div class="form-group">
<label for="username" class="col-sm-3 control-label">username</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="username" placeholder="Username">
</div>
</div>
<div class="form-group">
<label for="password" class="col-sm-3 control-label">Password</label>
<div class="col-sm-5">
<input type="password" class="form-control" id="password" placeholder="Password">
</div>
</div> <div class="form-group">
<label for="strenth" class="col-sm-3 control-label">Strenth</label>
<div class="col-sm-5">
<!-- <div id="messages"></div> -->
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-5">
<button type="submit" class="btn btn-default">Sign in</button>
</div>
</div>
</form>
我的jQuery-
jQuery(document).ready(function () {
var options = {
onLoad: function () {
$('#messages').text('Start typing password');
},
onKeyUp: function (evt) {
$(evt.target).pwstrength("outputErrorList");
}
};
$(':password').pwstrength(options);
});
希望有人可以幫助我。
將您的CSS路徑替換為head
標簽中的http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.