Hi all,
I have created a form for a module .I need to get a select all button which selects all the checkboxes. Being new, i donot have much idea how to do it.
If anyone of you have done anything like that then please help.
THanks all.

Comments

matt v.’s picture

The Drupal content administration page has a checkbox that triggers all other checkboxes within a table using jquery. The script used there, tableselect.js, should provide a good starting point for doing the same with a button.

--
Drupal Theme Developer’s Cheat Sheet | 45 Screencasts to Get You Kicking Ass with Drupal

akaash19’s picture

for all who are stuck like me.
Create a table using drupal style.
add in header array.
$header = array( theme('table_select_header_cell')
);
it comes automatically.worked for me.
thanks

sisyphus’s picture

i m looking for drupal standard way to do the "Select all"

What do u mean by "Create a table using drupal style" ?

could u pls show the detail steps on how to do the "Select all"

thanks a lot

akaash19’s picture

Drupal has its own api to create tables.you need not use html commands like

etc. All this is done by drupal functions in easier way.There you just have give the header that i have told before.
Regards
kamranzafar’s picture

This "theme('table_select_header_cell')" works for me thanks.