Jump to content

Select all checkboxes in one click


Dharmender

Recommended Posts

Output the checkbox wherever you want it to be. Then attach some Javascript to its onclick so that all the name=customers[] checkboxes are checked.

 

Are you using any Javascript framework, like jQuery or whatever else is still popular these days that isn't jQuery?

Output the checkbox wherever you want it to be. Then attach some Javascript to its onclick so that all the name=customers[] checkboxes are checked.

 

Are you using any Javascript framework, like jQuery or whatever else is still popular these days that isn't jQuery?

Using jquery.

Can I select all checkboxes using single click in Jquery. How can I get the values of all checkboxes in jquery for single click action

Can I select all checkboxes using single click in Jquery.

Yes.

 

How can I get the values of all checkboxes in jquery for single click action

Do you actually want the values? They don't matter if all you want to do is select them.

 

Give this a shot yourself and see how far you get and we can help you fix any problems you come across. An easy method would be to use a selector to find all checkboxes, .each() over them, and make each one checked if it's named "customers[]".

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.