惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
美团技术团队
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
云风的 BLOG
云风的 BLOG
有赞技术团队
有赞技术团队
T
The Blog of Author Tim Ferriss
WordPress大学
WordPress大学
月光博客
月光博客
宝玉的分享
宝玉的分享
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans
J
Java Code Geeks
博客园_首页
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
Vercel News
Vercel News
博客园 - 聂微东

博客园 - ★金★

导出EXCEL table变宽格式 IE11兼容性设定 C#获取多个相同name值 DIV左右行 Jquery绑定Select下拉菜单 SQL中多项合并时请加ISNULL Repeater中绑定下拉菜单的2种方法 WebForm设置URL路由后要照顾好之前的连接 Repeater中获取HTML select 值 NPOI生成Excel 博文阅读密码验证 - 博客园 Firefox中不支持parentElement用parentNode取代 jquery给span赋值的时候出现firefox不兼容 javascript可用数组取代case格式化字符 display和visibility的区别 SQL中Replace替换引号 javascript动态添加删除行后行内计算及取值 取代RadioButtonList及RadioButton方法
jquery表单验证增加确认及可选不需要验证的方法
★金★ · 2011-04-08 · via 博客园 - ★金★

增加如下代码,可在验证后再次确认,有时候很有用,如下:

 submitHandler: function (form) {
                
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');
            }
        });