jQuery.validate验证时用的是Form输入表单的name属性
来源:互联网 发布:淘宝网怎么退保证金 编辑:程序博客网 时间:2024/05/21 15:45
例如:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>test</title><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><meta http-equiv="Cache-Control" content="no-store" /><meta http-equiv="Pragma" content="no-cache" /><meta http-equiv="Expires" content="0" /> <link href="/static/jquery-easyui/1.2.6/themes/default/easyui.css"type="text/css" rel="stylesheet"><link href="/static/jquery-easyui/1.2.6/themes/icon.css"type="text/css" rel="stylesheet"><link href="/static/style/demo.css" type="text/css"rel="stylesheet"><link href="/static/jquery-validation/1.9.0/milk.css"type="text/css" rel="stylesheet" /> <script src="/static/jquery/1.7.2/jquery.min.js"type="text/javascript"></script><script src="/static/jquery-easyui/1.2.6/jquery.easyui.min.js"type="text/javascript"></script><scriptsrc="/static/jquery-validation/1.9.0/jquery.validate.min.js"type="text/javascript"></script><script src="/static/jquery-validation/1.9.0/messages_cn.js"type="text/javascript"></script> <script>$(document).ready(function() {$("#inputForm").validate({rules : {name:{required:true,minlength:"3"},password:{minlength:"3"},passwordConfirm:{equalTo : "#password"},email:{required:true,email:true}},messages : {}});});</script><title>PLMII:用户管理</title></head><body> <form id="inputForm" action="user!save.action" method="post"><table align="left"> <tr align="left"><td nowrap><label for="name" class="field">姓名:</label></td><td><input type="text" id="name" name="name" size="25" value=""/></td><td nowrap><label for="email" class="field">邮箱:</label></td><td><input type="text" id="email" name="email"size="25" value=""/></td> </tr> <tr align="left"><td nowrap><label for="password" class="field">密码:</label></td><td><input type="password" id="password" name="password" size="26" value="" /></td><td nowrap><label for="passwordConfirm" class="field">确认密码:</label></td><td><input type="password" id="passwordConfirm" size="26" value="" /></td> </tr> <tr> <td colspan=4 align="center"> <a href="#"class="easyui-linkbutton" iconCls="icon-ok"onclick='$("#inputForm").submit()'>提交</a> <a href="#" class="easyui-linkbutton" iconCls="icon-cancel"onclick="history.back(-1)">取消</a> </td> </tr> </table> </form></body></html>在这段代码中,不会验证两个密码是否相同,因为确认密码输入框只定义了其id,而未定义其name,将其name加上,则验证正常。
<tr align="left"> <td nowrap><label for="password" class="field">password:</label></td> <td><input type="password" id="password" name="password" size="26" value="" /></td> <td nowrap><label for="passwordConfirm" class="field">确认password:</label></td> <td><input type="password" id="passwordConfirm" name="passwordConfirm" size="26" value="" /></td></tr>
- jQuery.validate验证时用的是Form输入表单的name属性
- jQuery.validate验证时用的是Form输入表单的name属性
- Jquery validate验证表单时多个name相同的元素
- jquery.validate.js,多个name属性相同的验证
- Jquery的validate表单验证
- Jquery validate验证表单时多个name相同的元素只验证第一个的问题
- jQuery的form表单验证
- Struts2.0中使用JQuery的validate表单验证 取name问题
- jQuery的表单验证插件validate
- jQuery的validate.js表单验证插件
- 强大的表单验证插件 jquery validate
- jquery的validate简单表单验证
- 异步提交form的时候利用jQuery validate实现表单验证
- 如何在异步提交form的时候利用jQuery validate实现表单验证
- 异步提交form的时候利用jQuery validate实现表单验证
- 自定义表单输入验证jquery,validate,增加自己的方法,验证完并保存写入数据库
- validate的表单验证
- form表单中属性的有效性验证
- 详细解释:nginx中Nginx Main Module(主模块)配置及各个参数含义
- SQL 计算比例总结
- SQL Server中灾难时备份结尾日志(Tail of log)的两种方法
- Oracle忘记用户名密码
- MFC中通过控件ID设置控件焦点
- jQuery.validate验证时用的是Form输入表单的name属性
- lbfgs
- extjs 布局
- Spring quartz 时间配置规则
- Nginx+多个fastcgi实现负载均衡
- java-小心使用自动封装
- ppt 如何做好PPT演讲
- 二,三,四层交换机的区别
- 锻造tester&coder的无缝合作理想