我正在使用 jQuery validate 插件进行表单验证。它只是检查第一个字段。如果第一个字段验证为真,则它正在提交表单。它没有验证其余字段..
我正在使用引导程序 3.0
<script type="text/javascript">
$(document).ready(function(){
$('#contact').validate({
rules: {
firstname: {
required: true,
minlength: 5,
},
useremail: {
required: true,
}
}
});
})
</script>
<form action="" method="" id="contact">
<div class="form-group">
<label> Your Name </label>
<input type="text" class="form-control" placeholder="Enter Your Name" id="firstname" required="" minlength="5"/>
</div>
<div class="form-group">
<label> Your E-mail </label>
<input type="email" class="form-control" placeholder="Enter Your Email" id="useremail" required=""/>
</div>
<div class="form-group">
<label> Contact Detail </label>
<input type="text" class="form-control" placeholder="Enter Contact Number" id="mobile" minlength="10" maxlength="10" required=""/>
</div>
<div class="form-group">
<label> Type</label>
<select class="form-control">
<option> Inquiry </option>
<option> Complaints </option>
<option> Feedback </option>
<option> Others </option>
</select>
</div>
<div class="form-group">
<label> Message</label>
<textarea class="form-control" rows="3" cols="5" placeholder="Enter Your Message Here..." id="message" minlength='10' required=""></textarea>
</div>
<button type="submit" class="btn btn-primary btn-lg"> Send</button>
</form>
我不知道我的代码出了什么问题?请帮忙...
提前致谢