我有一个 submit() 事件附加到我的表单提交按钮,在我开始使用 jquery 验证插件之前,我可以通过单击提交这个表单。现在由于某种原因,它需要第二次点击。我怎样才能让它回到单击?
$("form").submit(function(){
$(".selector").validate({
rules: {
performance : {
required: true
//customvalidation: true
},
location : {
required: true
//customvalidation: true
},
date : {
required: true
//customvalidation: true
}
},
messages: {
performance : {
required: "enter a show name"
//customvalidation: true
},
location : {
required: "enter a location"
//customvalidation: true
},
date : {
required: "pick a date"
//customvalidation: true
}
}
return false;
}); //closes submit()
});