In my drupal 7 site I want to remove an apply button in form I created in Views (Exposed form in block = Yes). I tried this in my template.php:
function myproject_preprocess_views_exposed_form(&$vars, $hook) {
dpm($vars);
if ($vars['form']['#id'] == 'views-exposed-form-search-page') {
// Remove the submit button ??
unset($vars['form']['submit']);
}
}
... but that does not work. Can any one point me in the right direction? //Tommy EDITED: I now succeeded in removing the button, with this snippet:
function myproject_form_views_exposed_form_alter(&$form, &$form_state, $form_id) {
if ($form['#id'] == 'views-exposed-form-search-page') {
// submit on enter
// Remove the submit button ??
unset($form['submit']);
}
}
... so what I need now is how to submit the form on enter. I keep trying.