IE9中的Jquery验证将所有文本字段设置为必需。找不到为什么? 在我的表单中,我有更多字段不需要。但是当我单击“提交”时,类错误将添加到包含“不需要”的所有文本字段中。
以下是我的规则:
$(document).ready(function(){
setFields();
var validator = $("#frmContact").validate({
rules: {
ddQuestions:"required",
txtEmail: {
required: true,
email: true
},
txtName:{required: true, placeholder: true},
txtPhone:'customphone',
txtAddress: "required",
txtCity:"required",
ddStates:"required",
txtMessage:"required",
txtZipcode:{required:true,zipcodeUS:true},
},
messages: {
captcha: "Correct captcha is required. Click the captcha to generate a new one",
ddQuestions: "Please select a topic",
txtName:{required:"Do not forget put your name", placeholder: "Do not forget put your name"},
txtEmail:"Insert a valid email to be in contact",
txtAddress:"Don't forget put your address",
txtCity:"Please insert the city",
ddStates:"Please select the state",
txtMessage:"Don't forget put your message",
txtZipcode:"Insert a valid zipcode",
},
ignore:":not(:visible)"
});