Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 119933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:43:52+00:00 2026-05-11T03:43:52+00:00

I have a View with an exposed form . I am trying to a

  • 0

I have a View with an exposed form . I am trying to a few things on it. Ideally I would like to have a dropdown that fires the form with no button. If that is not possible then I would like to have the button text something different than apply.

I hacked it for now and change views_form in views.module but that does not seem like the right way to do it. I only have one exposed form right now, but what if I add more?

Please see http://www.wiredvillage.ca/News for my example.

I am poking around drupal.org and seeing others with the same problem but no solutions so far. Not sure where the best place to get Drupal help is.

Here is the change I made so far:

function views_exposed_form(&$form_state) {   // Make sure that we validate because this form might be submitted   // multiple times per page.   $form_state['must_validate'] = TRUE;   $view = &$form_state['view'];   $display = &$form_state['display'];   $form_state['input'] = $view->get_exposed_input();   // Let form plugins know this is for exposed widgets.   $form_state['exposed'] = TRUE;   $form['#info'] = array();   if (!variable_get('clean_url', FALSE)) {     $form['q'] = array(       '#type' => 'hidden',       '#value' => $view->get_url(),     );   }   // Go through each filter and let it generate its info.   foreach ($view->filter as $id => $filter) {     $view->filter[$id]->exposed_form($form, $form_state);     if ($info = $view->filter[$id]->exposed_info()) {       $form['#info']['filter-' . $id] = $info;     }   }    // I CHANGED The VALUE OF THIS SUBMIT BUTTON TO GO     $form['submit'] = array(     '#name' => '', // prevent from showing up in $_GET.     '#type' => 'submit',     '#value' => t('go'),   );   $form['#action'] = url($view->get_url());   $form['#theme'] = views_theme_functions('views_exposed_form', $view, $display);   $form['#id'] = views_css_safe('views_exposed_form-' . check_plain($view->name) . '-' . check_plain($display->id)); //  $form['#attributes']['class'] = array('views-exposed-form');   // If using AJAX, we need the form plugin.   if ($view->use_ajax) {     drupal_add_js('misc/jquery.form.js');   }   views_add_js('dependent');   return $form; } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:43:53+00:00Added an answer on May 11, 2026 at 3:43 am

    If you want the drop-down to fire, I’d use JavaScript instead of hacking the module as Eaton suggests.

    Basically, you can modify the text with hook_form_alter as Eaton suggests, then use in the same hook_form_alter, add a call to drupal_add_js with your custom JS which hides the button and submits the form on the onChange handler of the select drop-down. You want that submit button there for those 10% of users for whom the JS fails.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 72k
  • Answers 72k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Semaphores have two operations: P() To acquire the semaphore (you… May 11, 2026 at 1:42 pm
  • added an answer Objects will only be stored on the LOH if they… May 11, 2026 at 1:42 pm
  • added an answer Can you generate the jar file both ways extract them… May 11, 2026 at 1:42 pm

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.