jQuery验证 v1.17.0 - 零件

如果表单中有必填字段,则为其添加验证的最佳方法是通过jQuery验证工具。 我们已将其导入Material Dashboard Pro库并更改其颜色。

有关更多信息,请检查 Full Github Documentation.

Register Form

* Required fields
<form id="RegisterValidation">
<div class="card ">  
    <div class="card-header ">
    <h4 class="card-title">Register Form</h4>
    </div>

    <div class="card-body ">    
      <div class="form-group has-label">
          <label>
              Email Address
              *
          </label>
          <input class="form-control" name="email" type="email" required="true">
      </div>

      <div class="form-group has-label">
          <label>
              Password
              *
          </label>
          <input class="form-control" name="password" id="registerPassword" type="password" required="true">
      </div>

      <div class="form-group has-label">
          <label>
              Confirm Password
              *
          </label>
          <input class="form-control" name="password_confirmation" id="registerPasswordConfirmation" type="password" required="true" equalto="#registerPassword">
      </div>

      <div class="category form-category">* Required fields</div>
    </div>
    <div class="card-footer text-right">
    <div class="form-check pull-left">
                  <label class="form-check-label">
                      <input class="form-check-input" type="checkbox" value="" checked="">
                       Subscribe to newsletter
                      <span class="form-check-sign">
                          <span class="check"></span>
                      </span>
                  </label>
              </div>
      <button type="submit" class="btn btn-primary">Register</button>
    </div>
</div>
</form>