16th November 2012 - 7 minutes read time
I spent what seemed like an eternity today trying to figure out something in a form I was creating on a Drupal site. I was building a multi step form with previous and next buttons, both of which were submit elements like this.
$form['next'] = array(
'#type' => 'submit',
'#name' => 'next',
'#submit' => array(
'mymodule_next_submit'
),
'#value' => 'Next Step',
);
What I needed to do was override these and make them button elements instead of input elements. This involved creating a theme function in my template that looked like this. You could also do this in your module by adding theme overrides using hook_theme_registry_alter().