jQuery Bootstrap Password Meter is not working

jQuery Bootstrap Password Meter is not working

本文关键字:not working is Meter Bootstrap Password jQuery      更新时间:2023-09-26

我正在尝试为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>

我的j查询 -

jQuery(document).ready(function () {
  var options = {
    onLoad: function () {
      $('#messages').text('Start typing password');
    },
    onKeyUp: function (evt) {
      $(evt.target).pwstrength("outputErrorList");
    }
  };
  $(':password').pwstrength(options);
});

这是一个 JSBIN 与我到目前为止的所有代码

希望有人可以帮助我。谢谢。

将 css 路径替换为 http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.csshead 标记

在此处查看更新的 JSBIN