增加如下代码,可在验证后再次确认,有时候很有用,如下:
submitHandler: function (form) {
if (confirm("提醒:您确定要执行此次操作吗?")) { disableOtherSubmit(); $("#btnSubmit").val("处理中..."); form.submit(); }
if (confirm("提醒:您确定要执行此次操作吗?")) { disableOtherSubmit(); $("#btnSubmit").val("处理中..."); form.submit(); }
选择勾选项需不需要验证:
chkjedj: { required: "#chkjedj:checked" }
$("#chkjedj").click(function () {
var ischk = $("#chkjedj").is(":checked");
if (ischk) {
document.getElementById("shownmmail").style.display = "inline";
$('#txtzxnames').attr('disabled', '');
$('#txtzxemail').attr('disabled', '');
}
if (!ischk) {
document.getElementById("shownmmail").style.display = "none";
$('#txtzxnames').attr('disabled', 'disabled');
$('#txtzxemail').attr('disabled', 'disabled');
}
});
var ischk = $("#chkjedj").is(":checked");
if (ischk) {
document.getElementById("shownmmail").style.display = "inline";
$('#txtzxnames').attr('disabled', '');
$('#txtzxemail').attr('disabled', '');
}
if (!ischk) {
document.getElementById("shownmmail").style.display = "none";
$('#txtzxnames').attr('disabled', 'disabled');
$('#txtzxemail').attr('disabled', 'disabled');
}
});