Add custom field in exposed form in view I have a view with exposed form. I want to add some custom select field in this exposed form. I have tried with hook_form_alter() but the field is rendered in form submit button wrapper which is strange. How can I add a custom field to another one filters ?
You can define the field as a widget by messing with the #info part of the form in hook_form_alter - it's not very elegant but hey.

$form['text_search'] = array(
  '#type' =&gt; 'textfield',
  '#description' =&gt; t('Or start typing here to find your competition.'),
  '#default_value' =&gt; '',
);
// Create widget from new form item.
$new_form_info = array(
  'filter-text_search' =&gt; array('value' =&gt; 'text_search'),
);
// Put new widget definition at top, so widget will appear
// first (change order to change to desired position).
$form['#info'] = $new_form_info += $form['#info'];