1
基本上我需要清除這個表格,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"
}
}
});
});
我無法獲得提供的成功方法來做任何事情。提交後有沒有簡單的方法來填充輸入?