theme_button

Versions
5 – 6
theme_button($element)
7
theme_button($variables)

Returns HTML for a button form element.

Parameters

$variables An associative array containing:

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

Related topics

Code

drupal/includes/form.inc, line 3054

<?php
function theme_button($variables) {
  $element = $variables['element'];
  $element['#attributes']['type'] = 'submit';
  if (!empty($element['#name'])) {
    $element['#attributes']['name'] = $element['#name'];
  }
  $element['#attributes']['id'] = $element['#id'];
  $element['#attributes']['value'] = $element['#value'];
  $element['#attributes']['class'][] = 'form-' . $element['#button_type'];
  if (!empty($element['#attributes']['disabled'])) {
    $element['#attributes']['class'][] = 'form-button-disabled';
  }

  return '<input' . drupal_attributes($element['#attributes']) . ' />';
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.