These are chat archives for jzaefferer/jquery-validation

12th
Dec 2016
Dustin Lennon
@dustin-lennon
Dec 12 2016 19:52

I don't know if I am doing this wrong, but I'm trying to set a custom required message for my password field and it doesn't seem to be working. I am using version 1.15.0 with the following code

$("#registration").validate({
                errorElement: "div",
                rules: {
                    password: "required",
                    confirmPassword: {
                        required: true,
                        equalTo: "#password"
                    }
                },
                errorPlacement: function(error, element) {
                    error.appendTo("div#errors");
                },
                messages: {
                    password: "The password field was left blank and is required. Please enter the password you would like assigned to your account.",
                    confirmPassword: {
                        required: "This Confirm Password field is required. Please make sure it matches what you typed in the Password field.",
                        equalTo: "Your password fields do not match. Please try again."
                    }
                }
            });

However, when I leave both my password and confirm password fields blank, I only see the custom message for my confirm password field. I am presented with the default, "This field is required." message when leaving the password field blank.