BILL
BILL

Reputation: 4869

hide jQuery validation message

I want to disable error messages when checkbox checked. I wrote a script that disables some of the entry, but I do not know how to disable the error message.

My js code:

$().ready(
function () {
    $("#needPost").click(function () {
        if ($(this).is(':checked')) {
            //Need hide error Message

        } else {


        }
    }
    );

How to implement it?

Upvotes: 2

Views: 866

Answers (2)

Deept Raghav
Deept Raghav

Reputation: 1460

put all error messages with class error and add this in the error hide function if checked

$('.error').hide();

Upvotes: 0

Mikko
Mikko

Reputation: 602

For example if your error message has class "checkBoxError", you may put

$().ready(
function () {
    $("#needPost").click(function () {
        if ($(this).is(':checked')) {
            $(".checkBoxError").hide();
        } else {
            $(".checkBoxError").show();
        }
    }
    );
});

Upvotes: 1

Related Questions