Hi All - using hook_form_alter I can render my select-list fields as checkboxes when using exposed filters. However, the searching functionality no longer works. All Select-lists I ask to be rendered as checkboxes do so, and appear as I wish. However, after selecting a search criteria and hitting Apply, nothing happens (the URL does not change either - I am not updating via AJAX).

I have my view rendered as a page output. When I render the filters as select lists, the view I have created renders properly on my form (at /home). When I change the widgets to checkboxes, /home only shows the selection options, but no output.

Below is my module


<?php
 
function exposedviewsformalter_form_alter(&$form, $form_state, $form_id) {
 
 
if($form['#id'] == 'views-exposed-form-v-search-specials-page-1') {

$form['where']['#type'] =  'checkboxes';



}
 
}

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

I do not support changing widgets to checkboxes, as checkboxes do not work well in exposed filters.

flying_q’s picture

Thanks merlin....after posting that I realized I had not done enough research on the topic. Made my data structure much more taxonomy based and things are working like a dream.