0

我正在使用 Jquery validate 来执行客户端验证:表单在 .ascx 内 ... required 正在工作,但我无法让 minlength 或 maxlength 工作。我的代码中是否缺少某些内容。我正在使用的“名称”

<script>
    $(document).ready(function(){
        $("#form1").validate({
            rules: {
                curPass: {
                    required: true
                },
                NwPass: {
                    required: true,
                    minlength: 8,
                    maxlength: 16
                },
                cfmPass: {
                    required: true
                }
            }

        });
    });
</script>
</head>
<body id="body" style="background-image:url(http://www.regmovies.com/~/media/Images/Site%20Takeovers/wallpaper_cloudyNP.ashx);">


    <form id="form1" runat="server">
    <div>         
    <RCC:RCCChgPass runat="server" ID="ChgPass" />
    </div>
    </form>
4

1 回答 1

0

我怀疑生成的 HTML 中的 name 属性不是您所期望的,因此验证规则不适用于文本框。在浏览器中检查它。由于分配的 css 类,所需的验证有效。删除您的验证器 JS 代码并再次检查它,我希望它仍然根据要求进行验证

于 2013-11-04T18:54:07.067 回答