form_button

Versions
4.6
form_button($value, $name = 'op', $type = 'submit', $attributes = NULL)

Format an action button.

Parameters

$value Both the label for the button, and the value passed to the target page when this button is clicked.

$name The internal name used to refer to the button.

$type What type to pass to the HTML input tag.

$attributes An associative array of HTML attributes to add to the form item.

Return value

A themed HTML string representing the button.

Related topics

▾ 3 functions call form_button()

form_submit in includes/common.inc
Format a form submit button.
system_theme_settings in modules/system.module
Menu callback; display theme configuration for entire site and individual themes.
upload_form in modules/upload.module

Code

includes/common.inc, line 1392

<?php
function form_button($value, $name = 'op', $type = 'submit', $attributes = NULL) {
  return '<input type="'. $type .'" class="form-'. $type .'" name="'. $name .'" value="'. check_plain($value) .'" '. drupal_attributes($attributes) ." />\n";
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.