Blog / Drupal 6 - Expand Advanced Search fieldset if no keywords

Add this to your helper module: 

  /**
   * Implementation of hook_form_alter().
   *
   */
  function agentic_form_alter(&$form, $form_state, $form_id) {
    switch ($form_id) {
      case 'search_form':
      if (!arg(1)) { // if it's only /search and no keywords, expand the advanced search fieldset
      $form['advanced']['#collapsed']=FALSE;
      }
      break;
    }
  }
 

Leave a comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.

Sign up for updates