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();

 

posted @ 2014-10-30 22:02  apegu  阅读(393)  评论(0编辑  收藏  举报