runliuv

runliuv@cnblogs

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  708 随笔 :: 0 文章 :: 126 评论 :: 98万 阅读
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

 

页面上写2个button,一个普通button,另一个是submit,submit的这个隐藏。校验函数写在普通button里,普通button click函数中去提交表单。

 

页面:

 

<input type="button" value="提交" class="am-btn am-btn-success" onclick="if (!beforeSubmit()) { return false; }" />
<input type="submit" name="action" value="提交" id="tj" class="am-btn am-btn-success" style="display:none" />

 

JS:

 

复制代码
function beforeSubmit() {
            //alert("111");
            var DataVerification = $("#DataVerification").find('option:selected').val();
            if (DataVerification == '已开通') {
                //已开通 的存量数量不校验,比如:进件后修改简称等。
                $("#tj").click();
                return true;
            }
}
复制代码

 

 

方式2:

@using (Html.BeginForm("Create", "payMerchant", new { area = "PayLog" }, FormMethod.Post, new { id = "payMerchant_cr", @class = "am-form am-form-horizontal", enctype = "multipart/form-data", onsubmit = "return checksubmit()" }))

在BeginForm中增加 , onsubmit = "return checksubmit()"

 

posted on   runliuv  阅读(157)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
历史上的今天:
2021-01-12 打开TLS 1.1和1.2而不影响其他协议
2019-01-12 chrome flash
2017-01-12 美剧黑名单的插曲《Jolene》
2016-01-12 判断存储过程是否存在某个参数名
2015-01-12 Visual Studio Community 2013 中文语言包-离线安装版
点击右上角即可分享
微信分享提示