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

推荐订阅源

The Hacker News
The Hacker News
Google Online Security Blog
Google Online Security Blog
K
Kaspersky official blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Cisco Talos Blog
Cisco Talos Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyberwarzone
Cyberwarzone
L
LINUX DO - 最新话题
PCI Perspectives
PCI Perspectives
酷 壳 – CoolShell
酷 壳 – CoolShell
云风的 BLOG
云风的 BLOG
N
News and Events Feed by Topic
N
News and Events Feed by Topic
V
Vulnerabilities – Threatpost
T
Troy Hunt's Blog
GbyAI
GbyAI
C
CERT Recently Published Vulnerability Notes
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
量子位
Scott Helme
Scott Helme
月光博客
月光博客
Attack and Defense Labs
Attack and Defense Labs
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
Project Zero
Project Zero
G
GRAHAM CLULEY
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
小众软件
小众软件
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
爱范儿
爱范儿
S
Security @ Cisco Blogs
The Last Watchdog
The Last Watchdog
MongoDB | Blog
MongoDB | Blog
H
Hacker News: Front Page
Latest news
Latest news
P
Proofpoint News Feed

博客园 - 大老鼠

JQuery ajax 传递数组 自定义属性 JQuery元素坐标,偏移量 IE8按F12不显示开发人员工具窗口 JQuery AJAX调用WEB SERVICE方法 序列化/反序列化JSON sqlserver使用select加锁 jQuery操作解析JSON (sp_dbcmptlevel)将某些数据库行为设置为与指定的 SQL Server 版本兼容。 jQuery使用手册 效果-为操作添加艺术性 DOM操作-基于命令改变页面 事件 选择符-取得你想要的一切 jQuery入门 动态修改样式和层叠样式表 - 大老鼠 - 博客园 DOM2核心和DOM2 HTML 创建可重用的对象 JavaScript中常见陷阱 - 大老鼠 - 博客园
JQuery Validate验证表单元素 - 大老鼠 - 博客园
大老鼠 · 2010-07-04 · via 博客园 - 大老鼠
<fieldset>
    <legend>表单验证</legend>
    <p>
        <label for="username">用户名</label>
        <em>*</em>
        <input id="userName" name="username" size="25" 
            validate='{"rules":{"required":true},"messages":{"required":"请输入用户名"}}' />
    </p>
    <p>
        <label for="email">E-Mail</label>
        <em>*</em><input id="email" name="email" size="25" 
            validate='{"rules":{"required":true,"email":true},
            "messages":{"required":"请输入email","email":"请输入正确的email"}}'/>
    </p>
</fieldset>

/*
 *校验窗体元素
 *<input type="text" name="username" 
 *  validate='{
 *      "rules":{"required":true,"email":true},
 *      "messages":{"required":'请输入用户名',"email":'请输入email'}}'/>
*/
$(document).ready(function () {
    var validate = {
        rules: {},
        messages: {},
        focusInvalid: false,
        onkeyup: false,
        errorPlacement: function (error, element) {
            error.appendTo(element.parent());
        }
    };

    $('*[name]').each(function (index) {
        if ($(this).attr('validate')) {
            eval("var validateinfo=" + $(this).attr('validate'));
            validate.rules[$(this).attr('name')] = validateinfo.rules;
            validate.messages[$(this).attr('name')] = validateinfo.messages;
        }
    });

    $('form').validate(validate);
});