Validation JQuery验证插件不使用minlength
我已经为此奋斗了一段时间,并且进行了广泛的搜索,但没有结果。我抓取了一个链接,有人在这里回复我的同一个问题。我已经将代码复制到我的编辑器中,将样式表内联,正确链接了所有脚本,我认为Validation JQuery验证插件不使用minlength,validation,jquery-plugins,Validation,Jquery Plugins,我已经为此奋斗了一段时间,并且进行了广泛的搜索,但没有结果。我抓取了一个链接,有人在这里回复我的同一个问题。我已经将代码复制到我的编辑器中,将样式表内联,正确链接了所有脚本,我认为 <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"</script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.0/additional-methods.js"</script>
<style> #docs{
display:block;
postion:fixed;
bottom:0;
right:0;
}
</style>
</head>
<body>
<form id="form_validation_reg_generate_user">
<input type="text" name="userPassword" id="userPassword" />
<br/>
<input type="submit" />
</form>
<a id="docs" href="http://docs.jquery.com/Plugins/Validation" target="_blank">Validation Documentation</a>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script>
$(document).ready(function () {
$('form#form_validation_reg_generate_user').validate({
rules: {
userPassword: {
minlength: 5
}
},
submitHandler: function (form) { // for demo
alert('valid form submission'); // for demo
return false; //form demo
}
});
});
</script>
</body>
我正在用你的代码做一个测试,它似乎工作得很好。检查您的jquery.validate.min.js
路径是否正确,以及是否可以正确访问系统中的每个脚本
您还可以使用浏览器开发工具检查是否存在异常
我在本文中使用的jquery.validate.iin.js版本就是来自于此。也许你有一个更老的脚本?这就是答案!当我把它放好后,我又测试了一次,它按预期工作。谢谢