Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JQuery验证抛出未捕获的语法错误:意外数字_Jquery_Jquery Validate - Fatal编程技术网

JQuery验证抛出未捕获的语法错误:意外数字

JQuery验证抛出未捕获的语法错误:意外数字,jquery,jquery-validate,Jquery,Jquery Validate,我有一个使用jQuery validate的validate函数,该函数当前给了我一个错误: 未捕获的语法错误:意外数字 然而,我似乎无法找出我的代码到底出了什么问题。我已经试着通过注释删除了那些有问题的行,但我得到的只是另一个错误 未捕获的语法错误:意外的标识符 我的代码: <script type="text/javascript"> $(document).ready(function(){ $.extend($.validator.messages,{

我有一个使用jQuery validate的validate函数,该函数当前给了我一个错误:

未捕获的语法错误:意外数字

然而,我似乎无法找出我的代码到底出了什么问题。我已经试着通过注释删除了那些有问题的行,但我得到的只是另一个错误

未捕获的语法错误:意外的标识符

我的代码:

<script type="text/javascript">
    $(document).ready(function(){
        $.extend($.validator.messages,{
            equalTo: "Your passwords do not match.",
            remote: "The password you entered is incorrect."
        });

        $('#PasswordChange').validate(function() {
            rules: {
                ChangePassNew: {
                    required: true,
                    minlength: 6 //<-- the line giving the error.
                },
                ChangePassConfirmNew: { //<-- the line giving the new error once the offending line is commented out
                    required: true,
                    minlength: 6
                },
                ChangePassConfirmOld:{
                    required: true,
                    minlength: 6,
                    remote: "verifypass.php"
                },
                messages: {
                    ChangePassNew: {
                        required:"Please enter a password.",
                        minlength:"Please enter at least 6 characters."
                    },
                    ChangePassConfirmNew: {
                        required:"Please enter a password.",
                        minlength:"Please enter at least 6 characters."
                    },
                    ChangePassConfirmOld: {
                        required:"Please enter a password.",
                        minlength:"Please enter at least 6 characters.",
                        remote:"The password you entered is incorrect."
                    },
                },
            },
            submitHandler:function(form){
                form.submit();
            }
        });
    });
</script>

$(文档).ready(函数(){
$.extend($.validator.messages{
equalTo:“您的密码不匹配。”,
远程:“您输入的密码不正确。”
});
$('#PasswordChange')。验证(函数(){
规则:{
ChangePassNew:{
要求:正确,
最小长度:6/更改

您需要一个包含选项的对象,而不是函数

$('#PasswordChange').validate(function(){
$('#PasswordChange').validate({