How do I theme Form API buttons in Drupal?

Posted by larssg on Stack Overflow See other posts from Stack Overflow or by larssg
Published on 2008-11-06T12:27:54Z Indexed on 2010/05/27 14:41 UTC
Read the original article Hit count: 195

Filed under:
|
|
|

The default output from Drupal's Form API is:

<input id="edit-submit" class="form-submit" type="submit" value="Save" name="op"/>

How do I theme that so I get:

<button id="edit-submit" class="form-submit" type="submit">
  <span>Save</span>
</button>

I need the inner span-tag so I can use the sliding doors CSS technique.

I guess I need to override theme_button($element) from form.inc but my attempts so far have been unsuccessful.

© Stack Overflow or respective owner

Related posts about php

Related posts about drupal