我正在使用bootstrap3。我试图在bootstrap模式窗口中使用bootstrap验证器。我的表格没有标签。我已经添加了验证器所需的所有属性,但它仍然无法正常工作。 请指教。
我的代码是:
<div class="modal fade" id="forgotPassword" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Forgot your password ?</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12 col-lg-12">
<form id="forgotPwdForm" role="form" class="form-horizontal" method="post" class="form-horizontal" role="form" data-bv-message="This value is not valid" data-bv-feedbackicons-valid="glyphicon glyphicon-ok" data-bv-feedbackicons-invalid="glyphicon glyphicon-remove" data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
<div class="form-group">
<div class="col-md-12">
<input type="text" placeholder="Email ID" class="form-control" id="nameOrganization" name="nameOrganization" placeholder="Name/Organization" data-bv-notempty="true" data-bv-notempty-message="The Name/Organization is required and cannot be empty">
</div>
</div>
<div class="form-group">
<div class="col-md-12 text-left">
<button data-dismiss="modal" type="button" class="btn btn-success">Send me reset password instructions</button>
</div>
</div>
<div class="form-group">
<div class="col-md-12 text-left">
<a href=#">Didn't receive information instruction.</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
在标签中:
$(document).ready(function() {
$('#signupForm').bootstrapValidator();
});