4.7.x form.inc theme_submit($element)
5.x form.inc theme_submit($element)
6.x form.inc theme_submit($element)
7.x form.inc theme_submit($variables)

Returns HTML for a submit button form element.


$variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #attributes, #button_type, #name, #value.

Related topics


includes/form.inc, line 3899
Functions for form and batch generation and processing.


function theme_submit($variables) {
  return theme('button', $variables['element']);


lukus’s picture

I can't seem to override this in my template.php file .. seems that it's never called.

I haven't had any problems overriding other theme functions in Drupal 7.

EDIT: I can override theme_button()

Jieyyal’s picture

theme_submit never called at my custom theme too.

Have you fixed it?

tea.time’s picture

'submit' doesn't seem to be registered as a theme hook, actually.

drupal_common_theme() registers theme functions for form element types, and does not include it. And system_element_info() specifies that the submit element uses 'button' directly as a theme wrapper.

You could probably alter this with a combo of hook_theme_registry_alter() to actually define the theme hook, and hook_element_info_alter() to set it as the default theme wrapper for the submit element type.

cirrus3d’s picture

Using this hook on a bootstrap theme may break AJAX on Views with exposed filters (Submit/Reset buttons).

Unfortunately this seems to be a Views issue.

*** edit
This is the case for theme_button hook