views:

504

answers:

3

Hi,

How do I change an exposed views filter in Drupal 6 to checkboxes instead of the default multi select?

Thanks,

+1  A: 

The exposed filters are standard Drupal forms, so you can get to them before rendering via hook_form_alter() or hook_form_FORM_ID_alter(). The only tricky part is that they all seem to use the same form id 'views_exposed_filter' (IIRC), so you need to check for some additional hints to decide if you hooked into the right form.

Once there, you can modify the form element array in question as you like, e.g. changing the type from '#select' to '#checkboxes' (don't forget to adjust the default values and options to match your new type).

Henrik Opel
+1  A: 

Use Better Exposed Filters module.

infojunkie
Awesome! Took a little while, but is just the right thing.
aadvaark
A: 

how to adjust the default values and options to match new type. The option in select is very different from options in checkboxes.

Anyone can help?

sushil