基本上我需要清除这个表单,clearform:true 没有影响,如果我清空 submitHandler 中的文本框,则不会发送值。
$("#bottomContent").on('click', "#Button6", function(){
$("#Form6").validate({
errorContainer: "#Msg6",
errorLabelContainer: "#Msg6 ul",
errorElement: "li",
resetForm: true,
submitHandler: function(form) {
$('#prcs6').fadeIn('fast').delay(2000).fadeOut('fast');
$('#StartDate, #EndDate').delay(2000);
form.submit();
return false;
},
rules: {
StartDate: {
required: {
depends: function(element) {
return !$('#AllDates').is(':checked');
}
}
},
EndDate: {
required: {
depends: function(element) {
return $('#StartDate').val()!="";
}
}
}
},
messages: {
StartDate: {
required: "Please enter a starting date"
},
EndDate: {
required: "Please enter an ending date"
}
}
});
});
我也无法获得提供的成功方法来做任何事情。提交后是否有一种简单的方法来清空输入?