1
$(document).ready(function () {
              $("#frm").validate({
            errorClass:"invalid",
               rules: {
                    cname: { required: true,minlength:5 },
                    cemail: { required: true, email: true }
                }
            });
        });

I am using above function to validate my html form. Validation is working fine. But I want to remove the default error message. I dont want to give any error message, just need to change the background color of the control for which validation fails.

1 Answer 1

4

You can just give them an empty error message string, like this:

$("#frm").validate({
    errorClass:"invalid",
    rules: {
        cname: { required: true },
        cemail: { required: true, email: true }
    },
    messages: {
        cname: "",
        cemail: ""
    }
});

You can test it out here.​

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.