Active
Project:
Node and Comments Form Settings
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Jun 2011 at 08:49 UTC
Updated:
16 Jan 2012 at 15:06 UTC
Hi there,
to theme the cancel button with the module "button style" you need the wrapper around it.
Found this: http://drupal.org/node/133861#comment-4002698
I would add this to the button function :
...
// Javascript case
$form['buttons']['cancel'] = array(
'#type' => 'submit',
'#value' => t('Cancel'),
'#name' => 'cancel_button',
'#weight' => 20,
'#post_render' => array('change_button_type'),
'#prefix' => ' ',
'#attributes' => array('onClick' => 'history.go(-1); return true;')
);
break;
function change_button_type($markup, $element) {
$markup = str_replace('type="submit', 'type="button', $markup);
return $markup;
}
Comments
Comment #1
cj-a-min commentedI don't know what the repercussions are yet, but it works great and solves this issue.
http://drupal.org/node/708260