我看了很多例子,但没有一个对我有用。我在向导中有一个表单,并且我在整个网站上都使用了 Bootstrap,我看到并尝试了几个示例,但我没有运气。我希望有人可以帮助找出我做错了什么,提前
所以这是我的html:
<div class="input_align">
<label class="control-label4" for="facility_name">Facility Name</label>
<input type="text" class="input-largex3" name="facility_name" id="" required >
</div>
<div class="multi_align">
<div class="input_align input_col1">
<label class="control-label4" for="facility_npi">Facility NPI</label>
<input type="text" class="input-mini" id="" name="facility_npi">
</div>
<div class="input_align input_col2">
<label class="control-label2" for="fed_id">Fed ID</label>
<input type="text" class="input-mini" id="" name="fed_id">
</div>
<div class="input_align input_col2">
<label class="control-label2" for="medicare_id">Med ID</label>
<input type="text" class="input-mini" id="" name="med_id">
</div>
</div>
还有我的J
$('#new-contract').validate({
rules: {
facility_name: {
required: true,
},
facility_npi: {
required: true,
},
fed_id: {
minlength: 2,
required: true
}
},
highlight: function(label) {
$(label).closest('input').removeClass ('success').addClass('error');
},
success: function(label) {
label
.text('OK!').addClass('valid')
.closest('input').addClass('success');
},
errorPlacement: function(error, element) {
error.appendTo( element.parents ('input') );
}
});