js调用MVC3自带js验证
验证:
if ($(this).is("form")) {
return $(this).validate().checkForm();
}
事例:
$($.thisView.windowAddId + "-form").form({ onSubmit: function () { //进行表单验证 //如果返回false阻止提交 if ($(this).is("form")) { return $(this).validate().checkForm(); } return false; }, success: function (jsonResult) { jsonResult = $.parseJSON(jsonResult); if ($("#KeepOnAdd").is(":checked")) { $.clearValue($.thisView.windowAddId + "-form"); } else { $.tips(jsonResult); $($.thisView.windowAddId).window("close"); } $($.thisView.datagridId).datagrid("reload"); } }).submit();
作者:apegu
地址:http://www.cnblogs.com/jiangqw
如果,您认为阅读这篇博客让您有些收获,不妨点击一下推荐按钮。
浙公网安备 33010602011771号