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;
    }
  }
 

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.