Altering search form I am trying to alter my search form. I am following tutorial to learn drupal theming.
I want to replace the search button with an image : 

function mytheme_form_alter(&amp;$form, &amp;$form_state, $form_id) {
if ($form_id == 'search_block_form') {
$form['actions']['submit']['#type']= 'image_button';
$form['actions']['submit']['#src']= drupal_get_path('theme','MYTHEME').'/images/search.png';
$form['actions']['submit']['#attributes']['class'] [] = 'btn';
}
}


What i get in my page is the following result : 

&lt;input class="btn form-submit" type="image" id="edit-submit" name="submit" value="Search" src="http://mysite.com/sites/mysite.com/themes/MYTHEME/images/search.png"&gt;


However i want : 

class="btn" 


And not 

class="btn form-submit"


Did i miss something ? 

Thanks !
A much much easier way to do this is leave it at the default style and use CSS to replace it with an image. That is how it is done 9 times out of 10.

Now onto the question at hand, Drupal automatically adds certain classes based on the form type. The only way to remove the default classes is to override the THEME_button function and do it there, for more information see https://api.drupal.org/api/drupal/includes%21form.inc/function/theme_button/6