Design requirements sometimes dictate that standard form buttons be replaced with image equivalents. In this recipe, we will be replacing the Save and Preview buttons in node creation forms with image buttons.
We will be using the mysite module created earlier in this book. We will be adding two image buttons—one for Save and the other for the Preview button—to the form. It is assumed that these images are available as
preview.png, and stored in the myzen theme's
It is also worthwhile familiarizing ourselves with the syntax and general vagaries of the
button, image_button, and
submit form element types via the Form API reference manual at http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6#image_button ...