checking and unchecking multiple checkbox using jquery on datagrid

If you are working with any form or datagrid on which you want to list/display a set of data. Then may be sometimes you need to use multiple checkbox checking and unchecking features with a single checkbox check and uncheck in a form.

You can do it easily with jQuery in 2 steps…
Step1: Give a class name for the checkbox which you want to use as parent of all.


Step2: Write this single line of code on javascript for above added classname.

$('.dcFormCheckboxTh').click(function () {
    $(this).parents('table:eq(0)').find(':checkbox').attr('checked', this.checked);
});

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: