form_button
Definition
form_button($value, $name = 'op', $type = 'submit', $attributes = NULL)
includes/common.inc, line 1392
Description
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
| Name | Description |
|---|---|
| Form generation | Functions to enable output of HTML forms and form elements. |
| Input validation | Functions to validate user input. |
Code
<?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";
}
?> 