How to Change or Remove Views2 Exposed Button From Drupal

15 Jun 09 21:12
One minute read

Add this to your template file:

function YOUR_THEME_NAME_preprocess_views_exposed_form(&$vars, $hook) { //this is important

    // only alter the required form based on id
    if ($vars['form']['#id'] == 'views-exposed-form-where-to-buy-page-1') {

        // Change the text on the submit button
        $vars['form']['submit']['#value'] = t('Search');

        // Rebuild the rendered version (submit button, rest remains unchanged)
        $vars['button'] = drupal_render($vars['form']['submit']);

« Back to posts