You need to login to send post. No account yet? Create one:
Create account
Web design: Theming of Drupal's webform 'send' button
Fri, 02/05/2010 - 23:46
Based on this forum.
Web designer (of design of website itself) sometime needed a little bit more than CSS theming of Drupal buttons - change it in image in example. This can be done in 'template.php' file in your theme folder. First you need to define image buton itself - so add this code:
function phptemplate_button($element) {
$return_value = theme_button($element);
if ($element['#button_type'] == 'image') {
$return_value = str_replace('type="submit"','type="image"',$return_value);
}
return $return_value;
}
At second - change the button of webform. Add:
function NAME_OF_YOUR_THEME_webform_form($form) {
$form['submit']['#theme'] = 'button';
$form['submit']['#button_type'] = 'image';
$form['submit']['#attributes'] = array(
'src' => 'NEW_BUTTON_IMAGE.png',
'alt' => t('Send'),
'title' => t('Send')
);
return drupal_render($form);
}
Your button is going to live... Clear all caches and registry of theme!


















