I'd like to remove the label on this form and only show the input box. How is this possible?

Comments

sykora’s picture

If you're referring to the "Search this site" and the "Enter your keywords" labels, you can hide them by using

/* For the search block */
#search-block-form label {
    display: none;
}

/* For the search results page */
#search-form label {
    display: none;
}

Or do you want to remove the label completely?

hass’s picture

Yes, i'd like to remove this completely from source code.

Anonymous’s picture

Status: Active » Closed (fixed)

Not a bug and no activity since March 26, 2007.

Links:
Theme handbook en instructions how to override theme functions: http://drupal.org/theme-guide
Specifically for search: http://drupal.org/node/173880

Display:none can lead to SEO penalties as far as I know.

hass’s picture

Status: Closed (fixed) » Active

Sorry, but i cannot find a solution and i know both links.

Anonymous’s picture

Were you able to find this post?

http://drupal.org/node/242955

The search query I used in Google to find it:

theming search button 6.x site:drupal.org

Hopefully you will be able to find more help there.

Hope it helps

Please close if it is solved. :-)

hass’s picture

Status: Active » Fixed

The linked example is buggy. This one should be better.

<?php
// $Id: search-theme-form.tpl.php,v 1.0 2008/06/14 10:10:00 hass Exp $
?>
<div id="search" class="container-inline">
  <?php
  $search['search_theme_form'] = preg_replace('/<label(.*)>(.*)<\/label>\n/i', '', $search['search_theme_form']);
  print $search['search_theme_form'];
  print $search['submit'];
  print $search['hidden'];
  ?>
</div>
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.