Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Make Drupal 7 search button an image button.
* Implements hook_form_alter().
* Courtesy of JohnAlbin
function THEMENAME_form_search_block_form_alter(&$form, &$form_state) {
$form['actions']['submit']['#type'] = 'image_button';
$form['actions']['submit']['#src'] = drupal_get_path('theme', 'THEMENAME') . '/images/button-search.png';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment