Hi, I have a couple of images I designed to replace the "Save" and "Delete" buttons on my node edit page.
https://dl.dropbox.com/u/8495276/1304/buttons.png
I studied up on how to replace the default buttons with images like this. However, it appears my code is not entirely correct.
function MYTHEME_form_alter(&$form, &$form_state, $form_id) {
if($form_id == 'FORMIWANT') {
$form['actions']['submit']['#type'] = 'image_button';
$form['actions']['submit']['#src'] = drupal_get_path('theme', 'MYTHEME') . '/images/MYSAVEBUTTON.png';
$form['actions']['submit']['#attributes']['class'][] = 'MYCUSTOMCLASS';
}
The code above actually works fine; it replaces the Save button. The problem is when I add the following code which is intended to replace the Delete button:
$form['actions']['delete']['#type'] = 'image_button';
$form['actions']['delete']['#src'] = drupal_get_path('theme', 'MYTHEME') . '/images/MYDELETEBUTTON.png';
$form['actions']['delete']['#attributes']['class'][] = 'MYCUSTOMCLASS';
When I add this code, both buttons appear nicely - but they don't function correctly. Specifically, both buttons end up performing the same action. If you click my Save button, it wants to delete the node! :(