简单地使用jquery的validate

摘要:本文通过一个很简单的例子,讲解了jquery validate的最基础使用方式。

一、源代码

  注意事项都写在代码的注释里了,哈哈。

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>lwp</title> <!-- jquery,必须 -->
<script type="text/javascript" src="jquery-1.11.2.js"></script>
<!-- jquery的校验,必须 -->
<script type="text/javascript" src="jquery.validate.js"></script> <!-- 额外下载的校验规则大全,可选 -->
<script type="text/javascript" src="additional-methods.js"></script> <script>
$(function() {
/* 让表单使用jquery-validate的校验,必须 */
$("form").validate(); /* 用中文覆盖jquery-validate原有的英文提示,可选 */
jQuery.extend(jQuery.validator.messages, {
required : "不能为空",
email : "请输入正式的邮箱"
}); /* 自定义校验规则,可选 */
jQuery.validator.addMethod("lwp", function(value, element) {
if (value == "" || value == "liang") {
return true;
}
else {
return false;
}
}, "只能输入liang");
}); function check(){
/* 检查表单 */
if($("form").valid()) {
alert("提交成功");
}
else {
return false;
}
}
</script> <style>
/* 自定义的错误提示样式,覆盖jquery-validate自带的错误提示样式,可选 */
label.error {
color: #F00;
font-size: 12px;
}
</style>
</head> <body>
<form>
<div>
<label for="email">邮箱</label>
<!-- required和email是jquery-validate自带的校验规则 -->
<input type="text" autocomplete="off" name="email" required="true" email="true">
</div> <div>
<label for="author">作者</label>
<!-- lwp是自己定义的校验规则 -->
<input type="text" autocomplete="off" name="author" required="true" lwp="true">
</div> <div>
<input type="button" onclick="check();" value="提交">
</div>
</form>
</body> </html>

二、结果截图

  1、required的校验,截图如下:

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAARMAAABRCAIAAAB+LNU8AAAF00lEQVR4nO2cz27bOBCH+ZZ9DV8Ev4Lri2F4X6JY7GkPPRRFiwLFHnpY7HbbLhIsUihGajsOmsR/2sgOtAcDMk2RoxFNiwz1+yAElDWUBUMfZkiQEdfX14vF4uHh4fHxMQcA8BAwBwALYA4ANsAcAGyAOQDYAHMAsCEUcy6+pq9ev/v1t99xPPXj1et3F19T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V6e3t7x8fHk6gcHx/v7e318LQR0GD0J3Tt7Oy02+31P4WLot1u7+zsRPxSAIgOnmoJQIrATABSBGYCkCIwE4AUgZkApAjMBCBFYCYAKQIzAUgRmAlAivwP8L+ECiJ59JYAAAAASUVORK5CYII=" alt="" />

  3、校验通过之后的提交,截图如下:

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVUAAADHCAIAAAAmt1eFAAAc3klEQVR4nO2d228b153H+V/UlUTO5WyxRVshRTexZMGxkzhxYks2Y0m0m9jWhUmxoWxLlMRtElvkXHmb++289LJB/wS/tUWLFk371CZNt0la7KKvC6S7wTa9PKR9yD4cckzxPhQpcYa/LwTjeDwfnUPJP86cmTMfxmzXMy3H9TDG2HZcy3Y9D3sYW7ZrOy7G2PWwaTm262GMHRcbFtmMAQQQwLCDMdvxDNPyPIwxtmzXtGyMMcbYtGzLdjHGnocN07KdGqYZZq0/AAEEMORgrP6G4ZmW48M1AGPTcgjgetgwbaf25uEZpj10sFyufPP1+5k72Tv39nay+/d29l/b2rm7vbeT3b+7vffa1s69nf2d7P6de3uZO9ntnf2d7P7W3d2tu7s72f3t7D6A4wN+8/X7glg8tv85AA4MHq5/3BZze/c3DLBS0RTdOM4eARwRqOgGJ5ZDMdQJB3uc/yOEmk4b9M7nGwghfPh8Yyae6AckPYpSpe2JSk+w0xkOgCcIFstKWIY6yWCszWUD/OiyAUKo8bIBzaCZBEUzCCFEMWwTyCLkgxhj18PxBN3XhQqMPYwlWQl8hQMPemkEwBGDxbISlqFOMlg7/7ds1zCt+huGY1oOac/EE/6bh6abFMOSnjTdZFjUCCKE4gk6nqARQgghAiKEWBZNTccphiVvGZpuduqxUtEwxoZpNfZIhkt67D5UAMcKLAjFsAx1ksGYf/Jg2a7rYc/DtuNRNMOyiGFRgmIomkUI0QyybIdmEMbYcXGCoptAlkUE9DzsetiyXYpmm3Z2XGzZTtsebcctlzUC+qco/s7dQb9HAMcH5KVKWIY6yWDMdjxNN/03DP9gbpiWaT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r2/ROX9g7x65r2/e/86LdD/0GB/wv8X5DJDfi/wP8FmdyA/yswCPUPiUzA/xUYhPqHRCbg/wL/F2RyA/4v8H9BJjfg/woMQv1DIhPwfwUGof4hkQn4v2D9L2RyA/4v8H9BJjfg/woMQv1DIhPwf4H/CzK5Af8X+L8gkxvwfwUGof4hkQn4vwKDUP+QyAT8X+D/gkxuwP8F9/8hkxvwfwUGRVH8xS9+cdK/OAjkqHn77bdFUQT/VzDwu9/9d0mSMhBIyCNJ0ltvvQX+LwABBBD8XwACCCD4vwAEEEDwfwEIIIDYAf8XgABOMgj+LwABnFwQ/F8AAji5IPi/AARwckFY/wsggJML/j9bdT7Er/s0LgAAAABJRU5ErkJggg==" alt="" />

简单地使用jquery的validate的更多相关文章

  1. 基于jQuery的Validate表单验证

    表单验证可以说在前端开发工作中是无处不在的~ 有数据,有登录,有表单, 都需要前端验证~~  而我工作中用到最多的就是基于基于jQuery的Validate表单验证~  就向下面这样~ 因为今天有个朋 ...

  2. 经验分享:10个简单实用的 jQuery 代码片段

    尽管各种 JavaScirpt 框架和库层出不穷,jQuery 仍然是 Web 前端开发中最常用的工具库.今天,向大家分享我觉得在网站开发中10个简单实用的 jQuery 代码片段. 您可能感兴趣的相 ...

  3. jquery插件-validate

    1.引入js,css 下载地址:http://plugins.jquery.com/validate/ 2.设置验证规则:input的class添加以下验证属性 3.设置不符合规则的提示信息:添加da ...

  4. 10个简单实用的 jQuery 代码片段

    尽管各种 JavaScirpt 框架和库层出不穷,jQuery 仍然是 Web 前端开发中最常用的工具库. 今天,向大家分享我觉得在网站开发中10个简单实用的 jQuery 代码片段. 1.平滑滚动到 ...

  5. 使用jquery插件validate制作的表单验证案例

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. jQuery:validate表单验证基本使用

    jquery.validate是jquery的一个验证框架,可以迅速验证一些常见的输入,并且可以自己扩充自己的验证方法! 这里先从介绍简单的使用方法:jquery.validate.js下载地址 1. ...

  7. jQuery:validate添加自定义验证

    jQuery.validator.addMethod添加自定义的验证规则 addMethod:name, method, message 简单实例:单个验证的添加 <!DOCTYPE html ...

  8. jQuery校验validate详解(转)

    jQuery校验 官网地址:http://bassistance.de/jquery-plugins/jquery-plugin-validation 一导入js库 <script src=&q ...

  9. jquery的validate.js 和 form.js 的使用方法

    在使用 Jquery 的方法的验证并且修改 原Form 表单的提交方式的时候,需要引用的文件有 <script type="text/javascript" src=&quo ...

随机推荐

  1. windows下DOS命令中查看被占用端口的进程

    今天在用tomcat 运行项目时报错:   java.net.BindException: Address already in use: JVM_Bind这个错误   刚开始有点怀疑是javaw.e ...

  2. 解决CAS单点登录出现PKIX path building failed的问题

    在一次调试中,出现了这个错误: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExceptio ...

  3. 使用eclipse开发webService很简单

    原文转自:http://blog.csdn.net/guo_rui22/article/details/6253745 使用Eclipse生成一个WebService应用 1.创建一个Dynamic ...

  4. Android ListView异步加载数据

    1.主Activity public class MainActivity extends Activity { private ListView listView; private ArrayLis ...

  5. 阮老师讲解TF-IDF算法

    TF-IDF与余弦相似性的应用(一):自动提取关键词   作者: 阮一峰 日期: 2013年3月15日 这个标题看上去好像很复杂,其实我要谈的是一个很简单的问题. 有一篇很长的文章,我要用计算机提取它 ...

  6. LCD framebuffer驱动设计文档

    内容提要:1. android display相关的名词2. 调试LCD驱动需要注意的步骤3. 关于帧缓冲区及I/O内存---------------------------------------- ...

  7. Joomla的在线视频播放插件:AllVideos

    一个很好的插件,只需要在文章中插入一条简单的语句就可以实现视频播放,视频可以位于网站服务器上或其他视频网站的. 例如:{f4v}ShaHua-H264{/f4v}   我在使用中只有一个地方觉得需要更 ...

  8. linux btp 服务器 端及客户端配置

    Server端/etc/ntp.conf

  9. myEclipse和eclipse修改或复制项目名称后-更新部署名称

    一.myEclipse 复制后修改名称,访问不到项目 这是因为,你只是改了项目的名称,而没有改 下面是解决方法: 方法 1.右击你的项目,选择“properties”,在“type filter te ...

  10. Unicode与 utf8的互相转换

    <?php function unicode_encode($name) { $name = iconv('UTF-8', 'UCS-2', $name); $len = strlen($nam ...