首页 > 代码库 > Jquery validate 验证
Jquery validate 验证
1 必填和远程校验
$("#inputForm").validate({ rules: { "username": "required", "loginid": { remote: { type: "post", url: "${ctx}/user/isUniCode.do", data: { code: function() { return $("#loginid").val(); } }, dataType: "html", dataFilter: function(data, type) { if (data =http://www.mamicode.com/= "1")>2 密码验证
$("#inputForm").validate({<span style="white-space:pre"> </span>rules: {<span style="white-space:pre"> </span>pwd:{ <span style="white-space:pre"> </span>required: true,<span style="white-space:pre"> </span>minlength: 6 //自带判断字符最小长度<span style="white-space:pre"> </span>}, <span style="white-space:pre"> </span>pwdRepeat: { <span style="white-space:pre"> </span> required: true,<span style="white-space:pre"> </span> minlength: 6,<span style="white-space:pre"> </span> equalTo: "#pwd"<span style="white-space:pre"> </span>}<span style="white-space:pre"> </span>},<span style="white-space:pre"> </span>messages: {<span style="white-space:pre"> </span> <span style="white-space:pre"> </span><span style="white-space:pre"> </span>pwd:{ <span style="white-space:pre"> </span>required: '请输入密码', <span style="white-space:pre"> </span>minlength: "确认密码不能小于6个字符"<span style="white-space:pre"> </span>}, <span style="white-space:pre"> </span>pwdRepeat: { <span style="white-space:pre"> </span>required: "请输入确认密码", <span style="white-space:pre"> </span>minlength: "确认密码不能小于6个字符", <span style="white-space:pre"> </span>equalTo: "两次输入密码不一致" <span style="white-space:pre"> </span> } <span style="white-space:pre"> </span>}});Jquery validate 验证
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。