日期:2014-05-17  浏览次数:20558 次

MVC submit 验证是否为空 以及提交

 <input type="submit" name="Button1" value="受 理" onclick="return checkform();" id="Button1" class="input_btn" />
   //验证表单
   function checkform() {
  var isSucc = false;
  jQuery.checkForm({
      ctrls: [{ id: "DdlCaseSq", type: "mustSelect", par: "-1", msg: "社区不能为空" },
      { id: "DdlCaseWg", type: "mustSelect", par: "-1", msg: "网格不能为空" },
      { id: "TbHappenTime", type: "mustDate", par: "", msg: "事发时间不能为空" },
      { id: "DdlLy", type: "mustSelect", par: "-1", msg: "事发来源不能为空" },
      { id: "DdlDegree", type: "mustSelect", par: "-1", msg: "事件等级不能为空" },
      { id: "DdDx", type: "mustSelect", par: "-1", msg: "事件类别不能为空" },
      { id: "DdXx", type: "mustSelect", par: "-1", msg: "事件大类不能为空" },
      { id: "DdlXl", type: "mustSelect", par: "-1", msg: "事件小类不能为空" },
      { id: "TbBt", type: "mustInput", par: "", msg: "事件标题不能为空" },
      { id: "TbContent", type: "mustInput", par: "", msg: "事件内容不能为空" }
     ],
         success: function () {
              //提交成功提示:
                    isSucc = true;
                  },
                  failed: function (msg) {
                                //提交失败提示:
                                alert(msg);
                                isSucc = false;
                            }
                        });
                        return isSucc;
                    }      

如果符合条件,就进行提交。如果不符合就不进行提交。
现在问题是当我满足条件之后,怎么将数据提交到Controllers里面。