Form API Reference

This document provides a programmer's reference to the Drupal Form API. For a brief introduction on how to create forms, see the Form generation guide. For more extensive information about the Form API, see the Form API handbook.

Skip to: Properties | Default Values | Elements

Note that internal properties are not included in the table below, but are included in the Properties list. These include: #built, #children, #error, #id, #input, #printed, #validation_arguments

Form Controls

Legend:
X = attribute can be used with this type
- = attribute is not applicable to this type

#type checkbox checkboxes date fieldset file machine_name managed_file password password_confirm radio radios select tableselect text_format textarea textfield vertical_tabs weight
#access X X X X X X X X X X X X X X X X X X #access
#after_build X X X X X X X X X X X X X X X X X X #after_build
#ajax X X - - - X - - - X X X X X X X - - #ajax
#array_parents X X X X X X X X X X X X X X X X X X #array_parents
#attached X X X X X X X X X X X X X X X X X X #attached
#attributes X X X X X X X X - X X X X X X X - X #attributes
#autocomplete_path - - - - - X - - - - - - - - - X - - #autocomplete_path
#collapsed - - - X - - - - - - - - - - - - - - #collapsed
#collapsible - - - X - - - - - - - - - - - - - - #collapsible
#cols - - - - - - - - - - - - - X X - - - #cols
#default_tab - - - - - - - - - - - - - - - - X - #default_tab
#default_value X X X - - X - - - X X X X X X X - X #default_value
#delta - - - - - - - - - - - - - - - - - X #delta
#description X X X X X X X X X X X X - X X X - X #description
#disabled X X X - X X X X X X X X - X X X - X #disabled
#element_validate X X X X X X X X X X X X X X X X X X #element_validate
#empty - - - - - - - - - - - - X - - - - - #empty
#empty_option - - - - - - - - - - - X - - - - - - #empty_option
#empty_value - - - - - - - - - - - X - - - - - - #empty_value
#field_prefix X - - - - X - X X X - X - - X X - - #field_prefix
#field_suffix X - - - - X - X X X - X - - X X - - #field_suffix
#group - - - X - - - - - - - - - - - - - - #group
#header - - - - - - - - - - - - X - - - - - #header
#type checkbox checkboxes date fieldset file machine_name managed_file password password_confirm radio radios select tableselect text_format textarea textfield vertical_tabs weight #type
#js_select - - - - - - - - - - - - X - - - - - #js_select
#maxlength - - - - - X - X - - - - - - - X - - #maxlength
#multiple - - - - - - - - - - - X X - - - - - #multiple
#options - X - - - - - - - - X X X - - - - - #options
#parents X X X X X X X X X X X X X X X X X X #parents
#post_render X X X X X X X X X X X X X X X X X X #post_render
#prefix X X X X X X X X X X X X X X X X X X #prefix
#pre_render X X X X X X X X X X X X X X X X X X #pre_render
#process X X X X X X X X X X X X X X X X X X #process
#required X X X - X X - X X X X X - X X X - X #required
#resizable - - - - - - - - - - - - - X X - - - #resizable
#return_value X - - - - - - - - X - - - - - - - - #return_value
#rows - - - - - - - - - - - - - X X - - - #rows
#size - - - - X X - X X - - X - - - X - - #size
#states X X X X X X X X X X X X X X X X X X #states
#suffix X X X X X X X X X X X X X X X X X X #suffix
#theme X X X X X X X X X X X X X X X X X X #theme
#theme_wrappers X X X X X X X X X X X X X X X X X X #theme_wrappers
#title X X X X X X X X X X X X - X X X - X #title
#title_display X X X X X X X X X X X X - X X X - X #title_display
#tree X X X X X X X X X X X X X X X X X X #tree
#value_callback X X X X X X X X X X X X X X X X X X #value_callback
#weight X X X X X X X X X X X X X X X X X X #weight

Special Elements

#type actions button container image_button submit form hidden token markup item value
#access X X X X X X X X X X -
#action - - - - - X - - - - -
#after_build X X X X X X X X X X -
#ajax - X - X X - - - - - -
#attributes X X X X X X - - - - -
#button_type - X - X X - - - - - -
#default_value - - - - - - X X - - -
#description - - - - - - - - - X -
#disabled - X - X X - - - - - -
#element_validate - X - X X - X X X X -
#executes_submit_callback - X - X X - - - - - -
#limit_validation_errors - X - X X - - - - - -
#markup - - - - - - - - X X -
#method - - - - - X - - - - -
#name - X - - X - - - - - -
#parents X X X X X - X X X X -
#post_render X X X X X X X X X X -
#prefix X X X X X X X X X X -
#pre_render X X X X X X X X X X -
#process X X X X X X X X X X -
#return_value - - - X - - - - - - -
#src - - - X - - - - - - -
#submit - X - X X X - - - - -
#suffix X X X X X X X X X X -
#theme X X X X X X X X X X -
#theme_wrappers X X X X X X X X X X -
#title - - - - - - - - - X -
#title_display - - - - - - - - - X -
#tree X X X X X X X X X X -
#validate - X - X X X - - - - -
#value - X - X X - X X - - X
#weight X X X X X - X X X X -
#type actions button container image_button submit form hidden token markup item value

Default Values

Every element automatically has these default values (see system_element_info()):

The following is a list of default values which do not need to be set (found in system_element_info):

 

Elements

Note that property names in bold are those that will generally need to be defined when creating this form element. Default values are indicated in parentheses next to property names, if they exist.

actions

Description: A wrapper element to group one or more buttons in a form. Use of the 'actions' element as an array key helps to ensure proper styling in themes and to enable other modules to properly alter a form's actions.

Properties: #access, #after_build, #attributes #children, #id, #parents, #post_render, #pre_render, #prefix, #process, #states, #suffix, #theme, #theme_wrappers, #tree, #type, #weight

Usage example:

<?php
  $form
['actions'] = array('#type' => 'actions');
 
$form['actions']['submit'] = array(
   
'#type' => 'submit',
   
'#value' => t('Save'),
  );
 
$form['actions']['delete'] = array(
   
'#type' => 'button',
   
'#value' => t('Delete'),
  );
 
$form['actions']['cancel'] = array(
   
'#markup' => l(t('Cancel'), 'foo/bar'),
  );
?>

button

Description: Format an action button. When the button is pressed, the form will be submitted to Drupal, where it is validated and rebuilt. The submit handler is not invoked.

Properties: #access, #after_build, #ajax, #attributes, #button_type (default: submit), #disabled, #element_validate, #executes_submit_callback (default: FALSE), #limit_validation_errors, #name (default: op), #parents, #post_render, #prefix, #pre_render, #process, #submit, #states, #suffix, #theme, #theme_wrappers, #tree, #type, #validate, #value, #weight

Usage example (node.module):

<?php
$form
['preview'] = array(
 
'#type' => 'button',
  '#value'
=> t('Preview'),
  '#weight'
=> 19,
);
?>

checkbox

Description: Format a checkbox.

Properties: #access, #after_build, #ajax, #attributes, #default_value, #description, #disabled, #element_validate, #field_prefix, #field_suffix, #parents, #post_render, #prefix, #pre_render, #process, #required, #return_value (default: 1), #states, #suffix, #theme, #theme_wrappers, #title, #title_display (default: after), #tree, #type, #weight

Usage example (contact.module):

<?php
$form
['copy'] = array(
 
'#type' => 'checkbox',
  '#title'
=> t('Send me a copy.'),
);
?>

checkboxes

Description: Format a set of checkboxes. #options is an associative array, where the key is the #return_value of the checkbox and the value is displayed. The #options array cannot have a 0 key, as it would not be possible to discern checked and unchecked states.

Properties: #access, #after_build, #ajax, #attributes, #default_value, #description, #disabled, #element_validate, #options, #parents, #post_render, #prefix, #pre_render, #process, #required, #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree (default: TRUE), #type, #weight

Usage example (form_example_states.inc):

<?php
$form
['high_school']['tests_taken'] = array(
  
'#type' => 'checkboxes',
  
'#options' => drupal_map_assoc(array(t('SAT'), t('ACT'))),
  
'#title' => t('What standardized tests did you take?'),
...
),
?>

container

Description: Returns HTML to wrap child elements in a container. Surrounds child elements with a <div> and adds attributes such as classes or an HTML id.

Properties: #access, #after_build, #attributes #children, #id, #parents, #post_render, #pre_render, #prefix, #process, #states, #suffix, #theme, #theme_wrappers, #tree, #type, #weight

Usage example (field.form.inc):

<?php
 
if ($elements) {
   
// Also aid in theming of field widgets by rendering a classified
    // container.
   
$addition[$field_name] = array(
     
'#type' => 'container',
     
'#attributes' => array(
       
'class' => array(
         
'field-type-' . drupal_html_class($field['type']),
         
'field-name-' . drupal_html_class($field_name),
         
'field-widget-' . drupal_html_class($instance['widget']['type']),
        ),
      ),
     
'#weight' => $instance['widget']['weight'],
    );
  }
?>

date

Description: Format a date selection box. The #default_value will be today's date if no value is supplied. The format for the #default_value and the #return_value is an array with three elements with the keys: 'year', month', and 'day'. For example, array('year' => 2007, 'month' => 2, 'day' => 15)

Properties: #access, #after_build, #attributes, #default_value, #description, #disabled, #element_validate, #parents, #post_render, #prefix, #pre_render, #process, #required, #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree, #type, #weight

Usage example (profile.module):

<?php
$fields
[$category][$field->name] = array(
  
'#type' => 'date',
  '#title'
=> check_plain($field->title),
  '#default_value'
=> $edit[$field->name],
  '#description'
=> _profile_form_explanation($field),
  '#required'
=> $field->required
);
?>

fieldset

Description: Format a group of form items.

Properties: #access, #after_build, #attributes, #collapsed (default: FALSE), #collapsible (default: FALSE), #description, #element_validate, #parents, #post_render, #prefix, #pre_render, #process, #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree, #type, #weight

Usage example (contact.module):

<?php
$form
['contact'] = array(
  '#type'
=> 'fieldset',
  '#title'
=> t('Contact settings'),
  '#weight'
=> 5,
  '#collapsible'
=> TRUE,
  '#collapsed'
=> FALSE,
);
?>

file

Description: Format a file upload field.

Note: Drupal will add the code enctype="multipart/form-data", required by browsers to handle files, so it's not necessary to include it yourself.

Properties: #access, #after_build, #array_parents, #attached, #attributes, #description, #disabled, #element_validate, #parents, #post_render, #prefix, #pre_render, #process, #required, #size (default: 60), #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree, #type, #weight

Usage example (file.module):

<?php
$element
['upload'] = array(
   
'#name' => 'files[' . implode('_', $element['#parents']) . ']',
   
'#type' => 'file',
   
'#title' => t('Choose a file'),
   
'#title_display' => 'invisible',
   
'#size' => 22,
   
'#theme_wrappers' => array(),
   
'#weight' => -10,
  );
?>

form

Description: A form containing form elements

Properties: #access, #action (default: request_uri()), #after_build, #attributes, #method (default: 'post'), #post_render, #prefix, #pre_render, #process, #submit, #states, #suffix, #theme, #theme_wrappers, #tree, #validate

Usage example:

N/A

hidden

Description: Store data in a hidden form field.

Properties: #access, #after_build, #default_value, #element_validate, #parents, #post_render, #prefix, #pre_render, #process, #states, #suffix, #theme, #theme_wrappers, #tree, #type, #value, #weight

Usage example (block.module):

<?php
$form
['bid'] = array('#type' => 'hidden', '#value' => $bid);
?>

Note that if you plan to use JavaScript to change your hidden element's value, you will need to use the #default_value property rather than #value.

image_button

Description: Format a form submit button with an image.

Properties: #access, #after_build, #ajax, #attributes, #button_type (default: 'submit'), #disabled, #element_validate, #executes_submit_callback (default: TRUE), #limit_validation_errors, #parents, #post_render, #prefix, #pre_render, #process, #return_value (default: TRUE), #src, #submit, #states, #suffix, #theme, #theme_wrappers, #tree, #type, #validate, #value, #weight

item

Description: Generate a display-only form element allowing for an optional title and description.

Note: since this is a read-only field, setting the #required property will do nothing except theme the form element to look as if it were actually required (i.e. by placing a red star next to the #title).

Properties: #access, #after_build, #description, #element_validate, #markup, #parents, #post_render, #prefix, #pre_render, #process, #required, #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree, #type, #weight

Usage example (contact.module):

<?php
$form['from'] = array(
  
'#type' => 'item',
  '#title' => t('From'),
  '#markup' => $user->name .' &lt;'. $user->mail .'&gt;',
);

?>

machine_name

Description: Format a single-line text field to store a unique machine-readable name.

Provides a form element to enter a machine name, which is validated to ensure that the name is unique and does not contain disallowed characters. All disallowed characters are replaced with a replacement character via JavaScript.

The element validation checks that the submitted value

  • does not contain the replacement character only
  • does not contain disallowed characters
  • is unique; i.e., does not already exist
  • does not exceed the maximum length (via #maxlength)
  • cannot be changed after creation (via #disabled)

Non-standard form element properties:

  • #machine_name: (array)
    • exists: A function name to invoke for checking whether a submitted machine name value already exists. The submitted value is passed as argument. In most cases, an existing API or menu argument function can be re-used. The callback is only invoked, if the submitted value differs from the element's #default_value
    • source: (optional) The #array_parents of the form element containing the human-readable name (i.e., as contained in the $form structure) to use as source for the machine name. Defaults to array('name').
    • label: (optional) A text to display as label for the machine name value after the human-readable name form element. Defaults to "Machine name".
    • replace_pattern: (optional) A regular expression (without delimiters) matching disallowed characters in the machine name. Defaults to '[^a-z0-9_]+'.
    • replace: (optional) A character to replace disallowed characters in the machine name via JavaScript. Defaults to '_' (underscore). When using a different character, 'replace_pattern' needs to be set accordingly.

Properties: #access, #after_build, #ajax, #attributes, #autocomplete_path (default: FALSE), #default_value, #description (default: 'A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'), #disabled, #element_validate, #field_prefix, #field_suffix, #maxlength (default: 64), #parents, #post_render, #prefix, #pre_render, #process, #required (default: TRUE), #size (default: 60), #states, #suffix, #theme (default: 'textfield'), #theme_wrappers (default: 'form_element'), #title (default: 'Machine-readable name'), #title_display #tree, #type, #weight

Usage example (taxonomy.admin.inc):

<?php
$form['machine_name'] = array(
  '#type' => 'machine_name',
  '#default_value' => $vocabulary->machine_name,
  '#maxlength' => 21,
  '#machine_name' => array(
    'exists' => 'menu_edit_menu_name_exists',
  ),
);
?>

Usage example (menu.admin.inc):

<?php
$form['menu_name'] = array(
  '#type' => 'machine_name',
  '#title' => t('Menu name'),
  '#default_value' => $menu['menu_name'],
  '#maxlength' => MENU_MAX_MENU_NAME_LENGTH_UI,
  '#description' => t('A unique name to construct the URL for the menu. It must only contain lowercase letters, numbers and hyphens.'),
  '#machine_name' => array(
    'exists' => 'menu_edit_menu_name_exists',
    'source' => array('title'),
    'label' => t('URL path'),
    'replace_pattern' => '[^a-z0-9-]+',
    'replace' => '-',
  ),
  // A menu's machine name cannot be changed.
  '#disabled' => !empty($menu['old_name']) || isset($system_menus[$menu['menu_name']]),
);
?>

managed_file

Description: Provides a complete ajax/progress aware widget for uploading a file and saving it to the {file_managed} table.

By default a simple upload button is provided for choosing the file to upload. Once a file has been chosen it can be explicitly uploaded via the "Upload" button. The upload is via AJAX and a progress meter is displayed. The form's validate and submit handlers receive a file object ID in $form_state['values'] that represents the ID of the new file in the {file_managed} table.

The #managed_file element is expanded into a set of FAPI elements including two '#submit' buttons one for Upload one for Remove, a '#file' element and a handful of '#hidden' and '#markup' elements to handle progress indication and displaying of already uploaded files.

Note: New files are uploaded with a status of 0 and are treated as temporary files which are removed after 6 hours via cron. Your module is responsible for changing the $file objects status to FILE_STATUS_PERMANENT and saving the new status to the database. Something like the following within your submit handler should do the trick.

<?php
// Load the file via file.fid.
$file = file_load($form_state['values']['my_file_field']);
// Change status to permanent.
$file->status = FILE_STATUS_PERMANENT;
// Save.
file_save($file);
// Record that the module (in this example, user module) is using the file.
file_usage_add($file, 'user', 'user', $account->uid);
?>

(Without the call to file_usage_add, file_managed_file_validate produces an error upon saving the form, saying that the uploaded file may not be referenced.)

Once a file has been uploaded the file object's fid can be used as the #default_value for the form element. This will display an icon, a link to the file, and a remove button.

Clicking the remove button sets the value of the field to 0 and your module is responsible for actually removing the file from the files table and the file system using file_delete().

Non-standard form element properties:

  • #progress_indicator: options are 'none', 'bar', and 'throbber', default is 'throbber'.
  • #progress_message: (string) Progress message to display along with progress meter while a file is being uploaded. Defaults to NULL.
  • #upload_validators: (array) an array of callback functions to perform validation of uploaded files.
  • #upload_location (string) location on server where uploaded files should be stored. e.g.) 'public://files/my_files_director'

Properties: #access, #after_build, #array_parents, #attached, #attributes, #description, #disabled, #element_validate, #parents, #post_render, #prefix, #pre_render, #process, #states, #suffix, #theme, #theme_wrappers, #title, #tree, #weight

Usage example (image_example.pages.inc.):

<?php
// Use the #managed_file FAPI element to upload an image file.
$form['image_example_image_fid'] = array(
 
'#title' => t('Image'),
 
'#type' => 'managed_file',
 
'#description' => t('The uploaded image will be displayed on this page using the image style choosen below.'),
 
'#default_value' => variable_get('image_example_image_fid', ''),
 
'#upload_location' => 'public://image_example_images/',
);
?>

markup

Description: Generate generic markup for display inside forms. Note that there is no need to declare a form element as #type = 'markup', as this is the default type.

Note: if you use markup, if your content is not wrapped in tags (generally <p> or <div>), your content will fall outside of collapsed fieldsets.

Properties: #access, #after_build, #element_validate, #markup, #parents, #post_render, #prefix, #pre_render, #process, #states, #suffix, #theme, #theme_wrappers, #tree, #type, #weight

Usage example (contact.module):

<?php
$form
['contact_information'] = array(
  '#markup'
=> variable_get('contact_form_information', t('You can leave us a message using the contact form below.')),
);
?>

password

Description: Format a single-line text field that does not display its contents visibly.

Properties: #access, #after_build, #ajax, #attributes, #description, #disabled, #element_validate, #field_prefix, #field_suffix, #maxlength (default: 128), #parents, #post_render, #prefix, #pre_render, #process, #required, #size (default: 60), #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree, #type, #weight

Usage example (user.module):

<?php
$form
['pass'] = array(
  '#type'
=> 'password',
  '#title'
=> t('Password'),
  '#maxlength'
=> 64,
  '#size'
=> 15,
);
?>

password_confirm

Description: Format a pair of password fields, which do not validate unless the two entered passwords match.

Properties: #access, #after_build, #description, #disabled, #element_validate, #field_prefix, #field_suffix, #parents, #post_render, #prefix, #pre_render, #process, #required, #size (default: 60), #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree, #type, #weight

Usage example (user.module):

<?php
$form
['pass'] = array(
  '#type'
=> 'password_confirm',
  '#title'
=> t('Password'),
  '#size'
=> 25,
);
?>

radio

Description: Format a radio button.

Properties: #access, #after_build, #ajax, #attributes, #default_value, #description, #disabled, #element_validate, #field_prefix, #field_suffix, #parents, #post_render, #prefix, #pre_render, #process, #required, #return_value, #states, #suffix, #theme, #theme_wrappers, #title, #title_display (default: after), #tree, #type, #weight

Usage example:

N/A

radios

Description: Format a set of radio buttons.

Properties: #access, #after_build, #ajax, #attributes, #default_value, #description, #disabled, #element_validate, #options, #parents, #post_render, #prefix, #pre_render, #process, #required, #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree, #type, #weight

Usage example (poll.module):

<?php
  $active
= array(0 => t('Closed'), 1 => t('Active'));
...
  
$form['settings']['active'] = array(
    
'#type' => 'radios',
    
'#title' => t('Poll status'),
    
'#default_value' => isset($node->active) ? $node->active : 1,
    
'#options' => $active,
    
'#description' => t('When a poll is closed, visitors can no longer vote for it.'),
    
'#access' => $admin,
  );
?>

select

Description: Format a drop-down menu or scrolling selection box. See #empty_option and #empty_value for an explanation of various settings for a select element, including behavior if #required is TRUE or FALSE.

Properties: #access, #after_build, #ajax, #attributes, #default_value, #description, #disabled, #element_validate, #empty_option, #empty_value, #field_prefix, #field_suffix, #multiple, #options, #parents, #post_render, #prefix, #pre_render, #process, #required, #size, #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree, #type, #weight

Usage example (contact.admin.inc):

<?php
  $form
['selected'] = array(
   
'#type' => 'select',
   
'#title' => t('Selected'),
   
'#options' => array(
     
0 => t('No'),
     
1 => t('Yes'),
    ),
   
'#default_value' => $category['selected'],
   
'#description' => t('Set this to <em>Yes</em> if you would like this category to be selected by default.'),
  );
?>

submit

Description: Format a form submit button.

Properties: #access, #after_build, #ajax, #attributes, #button_type (default: 'submit'), #disabled, #element_validate, #executes_submit_callback (default: TRUE), #limit_validation_errors, #name (default: 'op'), #parents, #post_render, #prefix, #pre_render, #process, #submit, #states, #suffix, #theme, #theme_wrappers, #tree, #type, #validate, #value, #weight

Usage example (locale.module):

<?php
$form
['submit'] = array('#type' => 'submit', '#value' => t('Import'));
?>

tableselect

Description: A table created with a far left column of radios or checkboxes. Build the table headings and columns with the #headers property, and the rows with the #options property. See Adding checkboxes to a table for a full explanation.

Other settings:

  • To set accessibility tags for the radios or checkboxes, build one of the cells in the #options property using the 'title' => array( 'data' => array(#title => 'mytitle'))) construction, as in the $options variable in the usage example below. Drupal will create invisible label tags for the left column based on this value.
  • To disable the default "check all" button for the checkboxes, set #js_select property to FALSE. This is FALSE by default for radios.
  • Setting #multiple to TRUE will give you checkboxes instead of radios.

Properties: #access, #after_build, #ajax, #attributes, #default_value, #element_validate, #empty, #header, #js_select, #multiple, #options, #parents, #post_render, #prefix, #pre_render, #process, #states, #suffix, #theme, #theme_wrappers, #tree, #type, #weight

Usage example (node.admin.inc):

<?php
 
// Build the sortable table header.
 
$header = array(
   
'title' => array('data' => t('Title'), 'field' => 'n.title'),
   
'type' => array('data' => t('Type'), 'field' => 'n.type'),
   
'author' => t('Author'),
   
'status' => array('data' => t('Status'), 'field' => 'n.status'),
   
'changed' => array('data' => t('Updated'), 'field' => 'n.changed', 'sort' => 'desc')
  );
...
 
//Get the node data.
 
$nids = $query
   
->fields('n',array('nid'))
    ->
limit(50)
    ->
orderByHeader($header)
    ->
execute()
    ->
fetchCol();
 
$nodes = node_load_multiple($nids);
...
 
//Build the rows.
 
$options = array();
  foreach (
$nodes as $node) {
...
   
$options[$node->nid] = array(
     
'title' => array(
       
'data' => array(
         
'#type' => 'link',
         
'#title' => $node->title,
         
'#href' => 'node/' . $node->nid,
         
'#options' => $l_options,
         
'#suffix' => ' ' . theme('mark', array('type' => node_mark($node->nid, $node->changed))),
        ),
      ),
     
'type' => check_plain(node_type_get_name($node)),
     
'author' => theme('username', array('account' => $node)),
     
'status' => $node->status ? t('published') : t('not published'),
     
'changed' => format_date($node->changed, 'short'),
    );
  
//For simplicity, this example omits the code to set the operations column.
...
 
//Build the tableselect.
 
$form['nodes'] = array(
     
'#type' => 'tableselect',
     
'#header' => $header,
     
'#options' => $options,
     
'#empty' => t('No content available.'),
    );
?>

text_format

Description: A text-format-enabled version of a textarea.

Properties: #access, #after_build, #ajax, #attributes, #cols (default: 60), #default_value, #description, #disabled, #element_validate, #parents, #post_render, #prefix, #pre_render, #process, #required, #resizable (default: TRUE), #rows (default: 5), #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree,#type, #weight

Non-standard Properties:

  • #format: the format to apply. If you want to use the default format, set this property to NULL in your form constructor function, and the filter system will handle the rest.
  • #base_type (optional): defaults to 'textarea'. This makes it possible to also attach the text format selector to other form element types, such as textfields.

Usage example (taxonomy.admin.inc):

<?php
  $form
['description'] = array(
   
'#type' => 'text_format',
   
'#title' => t('Description'),
   
'#default_value' => $term->description,
   
'#format' => $term->format,
   
'#weight' => 0,
  );
?>

textarea

Description: Format a multiple-line text field.

Properties: #access, #after_build, #ajax, #attributes, #cols (default: 60), #default_value, #description, #disabled, #element_validate, #field_prefix, #field_suffix, #parents, #post_render, #prefix, #pre_render, #process, #required, #resizable (default: TRUE), #rows (default: 5), #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree, #type, #weight

Usage example (comment.module):

<?php
$form
['keywords'] = array(
'#title' => t('Keywords'),
'#type' => 'textarea',
'#description' => t ('The comment will be unpublished if it contains any of the phrases above. Use a case-sensitive, comma-separated list of phrases. Example: funny, bungee jumping, "Company, Inc."'),
'#default_value' => isset( $context['keywords']) ? drupal_implode_tags($context['keywords']) : '',
);
?>

textfield

Description: Format a single-line text field.

Properties: #access, #after_build, #ajax, #attributes, #autocomplete_path (default: FALSE), #default_value, #description, #disabled, #element_validate, #field_prefix, #field_suffix, #maxlength (default: 128), #parents, #post_render, #prefix, #pre_render, #process, #required, #size (default: 60), #states, #suffix, #text_format, #theme, #theme_wrappers, #title, #title_display, #tree, #type, #weight

Usage example (forum.module):

<?php
$form
['title'] = array(
  '#type'
=> 'textfield',
  '#title'
=> t('Subject'),
  '#default_value'
=> $node->title,
  '#size'
=> 60,
  '#maxlength'
=> 128,
  '#required'
=> TRUE,
);
?>

token

Description: Store token data in a hidden form field (generally used to protect against cross-site forgeries). A token element is automatically added to each Drupal form by drupal_prepare_form(), so you don't generally have to add one yourself.

Properties: #access, #after_build, #default_value, #element_validate, #parents, #post_render, #prefix, #pre_render, #process, #states, #suffix, #theme, #theme_wrappers, #tree, #type, #value, #weight

value

Description: A form value that is internal to the form and never displayed to the screen.

Properties: #type, #value

Usage example (node.module):

<?php
$form
['vid'] = array('#type' => 'value', '#value' => $node->vid);
?>

Note that as of Drupal 6, you can also simply store arbitrary variables in $form['#foo'] instead, as long as '#foo' does not conflict with any other internal property of the Form API.

vertical_tabs

Description: Formats all child fieldsets and all non-child fieldsets whose #group is assigned this element's name as vertical tabs.

Properties: #access, #after_build, #default_tab, #element_validate, #parents, #post_render, #prefix, #pre_render, #process, #states, #suffix, #theme, #theme_wrappers, #tree, #type, #weight

Functions that use vertical_tabs:
block_admin_configure in block.admin.inc
user_admin_settings in user.admin.inc

weight

Description: Format a weight selection menu.

Properties: #access, #after_build, #attributes, #default_value, #delta (default: 10), #description, #disabled, #element_validate, #parents, #post_render, #prefix, #pre_render, #process, #required, #states, #suffix, #theme, #theme_wrappers, #title, #title_display, #tree, #type, #weight

Usage example (menu.module):

<?php
$form
['weight'] = array(
  '#type'
=> 'weight',
  '#title'
=> t('Weight'),
  '#default_value'
=> $edit['weight'],
  '#delta'
=> 10,
  '#description'
=> t('Optional. In the menu, the heavier items will sink and the lighter items will be positioned nearer the top.'),
);
?>

Properties

#access

Used by: All elements and forms

Description: Whether the element is accessible or not; when FALSE, the element is not rendered and the user submitted value is not taken into consideration.

Values: TRUE or FALSE.

#action

Used by: form

Description: The path to which the form will be submitted.

Values: An internal path

Usage example (comment.module):

<?php
$form
['#action'] = url('comment/reply/'. $edit['nid']);
?>

#after_build

Used by: All elements and forms

Description: An array of function names which will be called after the form or element is built.

Usage example (system.admin.inc):

<?php
  $form
['file_public_path'] = array(
   
'#type' => 'textfield',
   
'#title' => t('Public file system path'),
   
'#default_value' => variable_get('file_public_path', conf_path() . '/files'),
   
'#maxlength' => 255,
   
'#description' => t('A local file system path where public files will be stored. This directory must exist and be writable by Drupal. This directory must be relative to the Drupal installation directory and be accessible over the web.'),
   
'#after_build' => array('system_check_directory'),
  );
?>

#ajax

Used by: button, checkbox, checkboxes, image button, password, radio, radios, select, submit, tableselect, textarea, text_format, textfield

An array of elements whose values control the behavior of the element with respect to the Drupal AJAX framework.

AJAX (Asynchronous Javascript and XML) is a term used for dynamic communication between the browser and the server, without page reloads. A purist would insist that the Drupal technique is AHAH (Asychronous HTML and HTTP) because XML is not used. Until Drupal 7, AJAX was known as AHAH. In a nutshell an AJAX request follows these steps:

  1. Drupal builds a form element with a set of #ajax properties. The misc/ajax.js file is included on the page automatically.
  2. ajax.js finds all the form elements on the page that have an #ajax['callback'] or an #ajax['path'] set and adds an event handler for the #ajax['event'] set on that form element.
  3. When the #ajax['event'] occurs on the element (such as 'click'), the AJAX request is made to the Drupal path of the element's #ajax['path']. If an #ajax['callback'] has been specified (the normal case), the Drupal path will be system/ajax.
  4. Form information gets processed, and the function specified in #ajax['callback'] is called.  #ajax['callback'] can return either HTML, a renderable array, or an array of AJAX commands.
  5. While the user waits for the callback to execute a throbber or progress bar is shown as determined by #ajax['progress']. The result is returned to the original page containing the form element.
  6. ajax.js gets the result. If it is HTML and #ajax['wrapper'] is set, the HTML replaces the element specified by #ajax['wrapper']. If it is an array of AJAX commands, the commands are executed. and inserts the returned HTML into the #ajax['wrapper']

Example usages of basic AJAX and AJAX commands are provided in the Examples module.

#ajax['callback']

Description: Specifies the name of a callback function which will be called during an AJAX call. It can return HTML, a renderable array, or an array of AJAX Commands. This callback function is given the $form and $form_state parameters, allowing it to produce a result, which it returns for rendering.

Note: #ajax['callback'] and #ajax['path'] are mutually exclusive. 'callback' is easier to use and requires less code setup, but may not provide the capabilities required for some functions. When you can, use 'callback'.

Values: String containing a function name.

Usage example (poll.module):

<?php
/**
 * Implementation of hook_form().
 */
function poll_form(&$node$form_state) {
  ...
  
$form['choice_wrapper']['poll_more'] = array(
    
'#type' => 'submit',
    
'#value' => t('More choices'),
    
'#description' => t("If the amount of boxes above isn't enough, click here to add more choices."),
    
'#weight' => 1,
    
'#submit' => array('poll_more_choices_submit'), // If no javascript action.
    
'#ajax' => array(
      
'callback' => 'poll_choice_js',
      
'wrapper' => 'poll-choices',
      
'method' => 'replace',
      
'effect' => 'fade',
    ),
  );
  ...
}

/**
 * Menu callback for AJAX additions. Render the new poll choices.
 */
function poll_choice_js($form, $form_state) {
  return $form['choice_wrapper']['choice'];
}
?>

#ajax['effect']

Description: Specifies the effect used when adding the content from an AJAX request.

Values: String. Possible values: 'none' (default), 'fade', 'slide'. If the interface elements library is installed, any effect with the name effectToggle may also be used.

#ajax['event']

Description: When this event occurs to this element, Drupal will perform an HTTP request in the background via Javascript.

Values: String. Possible values: Any valid jQuery event, including 'mousedown' (for submit, imagebutton, and button), 'blur' (for textfield and textarea), 'change' (for select). Note that #ajax['event'] does not need to be explicitly specified. Although it can be manually set, usually the default value will be sufficient.

#ajax['keypress']

Description: If set to TRUE, then the element's #ajax['event'] will be triggered if the ENTER key is pressed while the element has focus.

#ajax['method']

Description: Modify the behavior of the returned HTML from an AJAX request when inserting into the #ajax['wrapper']. If not set, the returned HTML will replace the contents of the wrapper element, but it's also possible to use any of the available jQuery operations for DOM manipulation.

Values: String. Possible values: 'replace' (default), 'after', 'append', 'before', 'prepend'.

#ajax['path']

Description: This is the Drupal menu path for a callback function which will generate HTML and return the string of HTML to Drupal. The result will replace the div specified in #ajax['wrapper']. This property is infrequently used in Drupal 7 and higher, because it is set automatically if using the #ajax['callback'] property. When using #ajax['callback'] the path is automatically set to system/ajax, which provides a menu callback that can be used for many situations.

Note: 'path' and 'callback' are mutually exclusive.

Values: String containing a Drupal menu path.

#ajax['prevent']

Description: A JavaScript event to prevent when 'event' is triggered. Defaults to 'click' for #ajax on #type 'submit', 'button', and 'image_button'. Multiple events may be specified separated by spaces. For example, when binding #ajax behaviors to form buttons, pressing the ENTER key within a textfield triggers the 'click' event of the form's first submit button. Triggering Ajax in this situation leads to problems, like breaking autocomplete textfields. Because of that, Ajax behaviors are bound to the 'mousedown' event on form buttons by default. However, binding to 'mousedown' rather than 'click' means that it is possible to trigger a click by pressing the mouse, holding the mouse button down until the Ajax request is complete and the button is re-enabled, and then releasing the mouse button. For this case, 'prevent' can be set to 'click', so an additional event handler is bound to prevent such a click from triggering a non-Ajax form submission. This also prevents a textfield's ENTER press triggering a button's non-Ajax form submission behavior.

Values: String. Possible values: One or more jQuery events, with multiple events separated by space characters.

#ajax['progress']

Description: Choose either a throbber or progress bar that is displayed while awaiting a response from the callback, and add an optional message.

Values: Array.

Possible keys: 'type', 'message', 'url', 'interval'

Possible values:

  • #ajax['progress']['type'] String. Possible values: 'throbber' (default), 'bar'.
  • #ajax['progress']['message'] String. An optional message to the user; should be wrapped with t().
  • #ajax['progress']['url'] String. The optional callback path to use to determine how full the progress bar is (as defined in progress.js). Only useable when 'type' is 'bar'.
  • #ajax['progress']['interval'] String. The interval to be used in updating the progress bar (as defined in progress.js). Ony used if 'url' is defined and 'type' is 'bar'.

Usage example (file.module):

<?php
  $ajax_settings
['progress']['type'] ? $ajax_settings['progress']['type'] == 'bar' : 'throbber';
 
$ajax_settings['progress']['message'] = NULL;
 
$ajax_settings['effect'] = 'none';
 
$element['remove_button'] = array(
   
'#name' => implode('_', $element['#parents']) . '_remove_button',
   
'#type' => 'submit',
   
'#value' => t('Remove'),                                           
   
'#validate' => array(),
   
'#submit' => array('file_managed_file_submit'),
   
'#limit_validation_errors' => array($element['#parents']),
   
'#ajax' => $ajax_settings,
   
'#weight' => -5,
  );
?>

#ajax['trigger_as']

Description: For a non-submit, non-button element, allows selection of the submit element which will be activated when the element is triggered. For example, if a select element is ajax-enabled, and it changes, an element identified by #ajax['trigger_as']['name'] or #ajax['trigger_as']['value'] will be used as the triggering element, especially for button-level validation.

Values: Array.

Possible values

  • array('name' => some_submit_or_button_name)
  • array('value' => some_submit_or_button_value)

Note that if #tree == TRUE, #name encodes the parents of the element in it, as when used with form_set_error(), i.e. "level1][level2][element".

#ajax['wrapper']

Description: This property defines the HTML id attribute of an element on the page which will be replaced by the html returned by the #ajax['path'] or #ajax['callback'] function. Usually, a div element is used as the wrapper, as it provides the most flexibility for placement of elements before, after, or inside of its HTML tags. This property is required for using AJAX requests in on a form element.  Note that the entire element with this ID is replaced, not just the contents of the element.

Values: String containg a valid id attribute of an HTML element on the same page. This must not contain the '#' character that a selector would have.

Usage example (upload.module):

    $form['new']['attach'] = array(
     
'#type' => 'submit',
     
'#value' => t('Attach'),
     
'#name' => 'attach',
     
'#ajax' => array(
       
'path' => 'upload/js',
       
'wrapper' => 'attach-wrapper',
       
'progress' => array('type' => 'bar', 'message' => t('Please wait...')),
      ),
     
'#submit' => array('node_form_submit_build_node'),
    );

#array_parents

Used by: All form elements

Description: (read-only, and mostly internal). The array of names of the element's parents (including itself) in the form. This will always match the structure of $form. It is different from #parents in that #parents lists only the structure used in $form_state['values'], which is flat unless #tree is set to TRUE. Please see the complete comparison between #parents and #array_parents.

#attached

Used by: All form elements

Description: Allows loading of CSS, Javascript, libraries, or custom types when the form is built.

Values: A keyed array of type => value pairs, where the type (most often 'css', 'js', and 'library') determines the loading technique, and the value provides the options presented to the loader function. See the example below and the loader functions drupal_add_css(), drupal_add_js(), drupal_add_library(), etc.

See drupal_process_attached() for additional information.

Usage example (AJAX Example):

$form['#attached']['css'] = array(
drupal_get_path('module', 'ajax_example') . '/ajax_example.css',
);
$form['#attached']['js'] = array(
drupal_get_path('module', 'ajax_example') . '/ajax_example.js',
);

The above javascript #attach could also be written as:

$form['#attached']['js'] = array(
  drupal_get_path('module', 'ajax_example') . '/ajax_example.js' => array(
  'type' => 'file',
  ),
);

and inline javascript can be loaded with the javascript as the key of the array, as described in drupal_add_js().

Adding settings

You add a javascript setting by using the 'data' key (as php keys can't be arrays):

$settings = array('id' => 'mymodule-element-1');
$form['#attached']['js'][] = array(
  'data' => array('mymodule' => $settings),
  'type' => 'setting',
);

Usage example (contact.pages.inc):

<?php
if (!$user->uid) {
$form['#attached']['library'][] = array('system', 'jquery.cookie');
$form['#attributes']['class'][] = 'user-info-from-cookie';
}
?>

#attributes

Used by: actions, button, checkbox, checkboxes, container, date, fieldset, file, form, image_button, password, radio, radios, select, submit, tableselect, textarea, text_format, textfield, weight

Description: Additional HTML attributes, such as 'class' can be set using this mechanism.

Values: Any HTML attribute not covered by other properties, e.g. class (for control types), enctype (for forms).

Usage example (search.module):

Note: If you are altering an existing form via hook_form_alter() or a similar means, be careful with this property! You will probably want to add to the existing array rather than writing over it, so don't follow this usage example exactly.

<?php
$form
['#attributes'] = array('class' => array('search-form'));
?>

#autocomplete_path

Used by: textfield

Description: The path the AJAX autocomplete script uses as the source for autocompletion.

Usage example (node.module):

<?php
$form
['author']['name'] = array(
  '#type'
=> 'textfield',
  '#title'
=> t('Authored by'),
  '#maxlength'
=> 60,
  '#autocomplete_path'
=> 'user/autocomplete',
  '#default_value'
=> $node->name,
  '#weight'
=> -1,
);
?>

#built

Used by: form

Description: Used to ascertain whether or not a form element has been built yet.

Values: TRUE or FALSE

Usage example: INTERNAL. See the _form_builder function in form.inc.

#button_type

Used by: button, image_button, submit

Description: Adds a CSS class to the button, in the form form-[button_type_value]. Note that this does NOT set the HTML attribute type of the button.

Values: String

Usage example: (system.module):

$types['submit'] = array(
  '#input' => TRUE,
  '#name' => 'op',
  '#button_type' => 'submit',
  '#executes_submit_callback' => TRUE,
  '#limit_validation_errors' => FALSE,
  '#process' => array('ajax_process_form'),
  '#theme_wrappers' => array('button'),
);

#children

Used by: All elements.

Description: Internal. The rendered child elements of an element. Automatically assigned by drupal_render(), unless already set. In rare cases, you may use #children to override the output of rendered child elements, for example in a #theme_wrappers or #post_render callback. Normally, you should not have to use #children, use regular child elements instead. (See actions for an example.)

Values: String representing the rendered child elements of an element.

Usage example theme_container()):
Example in a #theme_wrappers callback.

<?php
function theme_container($variables) {
 
$element = $variables['element'];

 
// ...

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

#collapsed

Used by: fieldset

Description: Indicates whether or not the fieldset is collapsed by default. See #collapsible property.

Values: TRUE or FALSE

Usage example (block.module):

<?php
$form
['block'] = array(
  '#type'
=> 'fieldset',
  '#title'
=> t('Block configuration'),
  '#weight'
=> 3,
  '#collapsible'
=> TRUE,
  '#collapsed'
=> FALSE,
  '#tree'
=> TRUE,
);
?>

#collapsible

Used by: fieldset

Description: Indicates whether or not the fieldset can be collapsed with JavaScript. See #collapsed property.

Values: TRUE or FALSE

Usage example (block.module):

<?php
$form
['block'] = array(
  '#type'
=> 'fieldset',
  '#title'
=> t('Block configuration'),
  '#weight'
=> 3,
  '#collapsible'
=> TRUE,
  '#collapsed'
=> FALSE,
  '#tree'
=> TRUE,
);
?>

#cols

Used by: text_format, textarea

Description: How many columns wide the textarea should be (see also #rows)

Values: A positive number

Usage example (aggregator.module):

<?php
$form
['description'] = array(
  
'#type' => 'textarea',
  '#title'
=> t('Description'),
  '#default_value'
=> $edit['description'],
  '#cols'
=> 60,
  '#rows'
=> 5,
);
?>

#default_tab

Used by: vertical_tabs

Description: The default open tab.

Values: String containing the HTML ID of the fieldset element for the default tab. The default value is an empty string, which results in the first tab having the focus. The fieldset's HTML ID typically takes the form of "edit-ARRAY_KEY".

Usage example:

<?php
$form
['vertical_tabs'] = array(
'#type' => 'vertical_tabs',
'#default_tab' => 'edit-tab2',
);
$form['tab1'] = array(
'#type' => 'fieldset',
'#title' => t('Tab 1'),
'#collapsible' => TRUE,
'#group' => 'vertical_tabs',
);
$form['tab1']['field1'] = array(
'#title' => t('Field 1'),
'#type' => 'textfield',
);
$form['tab2'] = array(
'#type' => 'fieldset',
'#title' => t('Tab 2'),
'#collapsible' => TRUE,
'#group' => 'vertical_tabs',
);
$form['tab2']['field2'] = array(
'#title' => t('Field 2'),
'#type' => 'textfield',
);
?>

#default_value

Used by: checkbox, checkboxes, date, hidden, radio, radios, select, tableselect, textarea, text_format, textfield, token, weight

Description: The value of the form element that will be displayed or selected initially if the form has not been submitted yet. Should NOT be confused with #value, which is a hard-coded value the user cannot change!

Values: Mixed

Usage example (forum.module):

<?php
$form
['body'] = array(
 
'#type' => 'textarea',
  '#title'
=> t('Body'),
  '#default_value'
=> $node->body,
  '#required'
=> TRUE,
);
?>

#delta

Used by: weight

Description: Number of weights to have selectable. For example, with $delta => 10, the weight selection box would display numbers from -10 to 10.

Values: A positive number

Usage example (menu.module):

<?php
$form
['weight'] = array(
  '#type'
=> 'weight',
  '#title'
=> t('Weight'),
  '#default_value'
=> $edit['weight'],
  '#delta'
=> 10,
  '#description'
=> t('Optional. In the menu, the heavier items will sink and the lighter items will be positioned nearer the top.'),
);
?>

#description

Used by: checkbox, checkboxes, date, fieldset, file, item, password, password_confirm, radio, radios, select, text_format, textarea, textfield, weight

Description: The description of the form element. Make sure to enclose inside the t() function so this property can be translated.

Values: Mixed

Usage example (menu.module):

<?php
$form
['weight'] = array(
  '#type'
=> 'weight',
  '#title'
=> t('Weight'),
  '#default_value'
=> $edit['weight'],
  '#delta'
=> 10,
  '#description'
=> t('Optional. In the menu, the heavier items will sink and the lighter items will be positioned nearer the top.'),
);
?>

#disabled

Used by: button, checkbox, checkboxes, date, file, image_button, password, password_confirm, radio, radios, select, submit, text_format, textarea, textfield, weight

Description: Disables (greys out) a form input element. Setting #disabled to TRUE results in user input being ignored, regardless of how the element is themed or whether JavaScript is used to change the control's attributes.

Values: TRUE or FALSE

Usage example (system.module):

<?php
     
if (isset($disabled[$name])) {
       
$form['theme_settings'][$name]['#disabled'] = TRUE;
      }
?>

#element_validate

Used by: Any element.

Description: A list of custom validation functions. The validation functions must use form_error() or form_set_error() to flag the element as having an error if the validation fails.

Values: An array of function names to be called to validate this element (and/or its children).

A validation function for an element takes $element, $form_state, and $form as parameters, and has the form:

function myelement_validate($element, &$form_state, $form) {
   if (empty(
$element['#value'])) {
    
form_error($element, t('This field is required.'));
   }
}

Usage example (file.field.inc):

Note: If you are altering an existing form element via hook_form_alter() or a similar means, be careful with this property! You will probably want to add to the existing array rather than writing over it, so in that case don't follow this usage example exactly.

You'll notice that the validation function below includes only the first two arguments. $form is the same as $form_state['complete form'], so the third parameter is in fact contained in the second parameter.

<?php
$form
['max_filesize'] = array(
   
'#type' => 'textfield',
   
'#title' => t('Maximum upload size'),
   
'#default_value' => $settings['max_filesize'],
   
'#description' => t('Enter a value like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes) in order to restrict the allowed file size. If left empty the file sizes will be limited only by PHP\'s maximum post and file upload sizes (current limit <strong>%limit</strong>).', array('%limit' => format_size(file_upload_max_size()))),
   
'#size' => 10,
   
'#element_validate' => array('_file_generic_settings_max_filesize'),
   
'#weight' => 5,
  );
...
function
_file_generic_settings_max_filesize($element, &$form_state) {
  if (!empty(
$element['#value']) && !is_numeric(parse_size($element['#value']))) {
   
form_error($element, t('The "!name" option must contain a valid value. You may either leave the text field empty or enter a string like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes).', array('!name' => t($element['title']))));
  }
}
?>

#empty

Used by: tableselect

Description: Text to display if the #options property is empty.

Values: Text, enclosed in the t() translation function.

#empty_option

Used by: select

Description: The label to show for the initial option denoting no selection in a select element. By default, the label is automatically set to "- Select -" for a required field and "- None -" for an optional field.

Values: Text, enclosed in the t() translation function.

Note: Use of this property plays a part in several possible states for a select field:

  • If #required is TRUE and there is no #default_value, an empty option is added to the select control to force the user to make an active choice.
  • If #empty_value or #empty_option is set and #required is FALSE (default), an empty option is added to the select control, allowing the user to choose nothing.
  • If none of #required, #empty_value, #empty_option, and #default_value are set, then no empty option is added to the select control. This leaves the control in a slightly illogical state, since all user agents automatically preselect the first available option.There's no way for the user to select nothing, and the user is also not forced to make an active decision.

#empty_value

Used by: select

Description: The value for the initial option denoting no selection in a select element, which is used to determine whether the user submitted a value or not.

Values: Defaults to empty string. Can be anything except NULL.

Note: Use of this property plays a part in several possible states for a select field:

  • If #required is TRUE and there is no #default_value, an empty option is added to the select control to force the user to make an active choice.
  • If #empty_value or #empty_option is set and #required is FALSE (default), an empty option is added to the select control, allowing the user to choose nothing.
  • If none of #required, #empty_value, #empty_option, and #default_value are set, then no empty option is added to the select control. This leaves the control in a slightly illogical state, since all user agents automatically preselect the first available option. There's no way for the user to select nothing, and the user is also not forced to make an active decision.

#error

INTERNAL. Indicates whether or not a form element has been flagged as having an error.

#executes_submit_callback

Used by: button, image_button, submit

Description: Indicates whether or not the submit handler should be run when the form is submitted using this button element.

Values: TRUE or FALSE

#field_prefix

Used by: checkbox, machine_name, password, password_confirm, radio, select, textarea, textfield

Description: Text or code that is placed directly in front of the textfield. This can be used to prefix a textfield with a constant string.

Values: Mixed

Usage example (system.module):

<?php
$form
['site_403'] = array(
  
'#type' => 'textfield',
  
'#title' => t('Default 403 (access denied) page'),
  
'#default_value' => variable_get('site_403'''),
  
'#size' => 40,
  
'#description' => t('This page is displayed when the requested document is denied to the current user. If unsure, specify nothing.'),
  
'#field_prefix' => url(NULLNULLNULLTRUE) . (variable_get('clean_url'0) ? '' '?q=')
);
?>

#field_suffix

Used by: checkbox, machine_name, password, password_confirm, radio, select, textarea, textfield

Description: Text or code that is placed directly after a textfield. This can be used to add a unit to a textfield.

Values: Mixed

Usage example (system.module):

<?php
$form
['settings_general']['upload_usersize_default'] = array(
  
'#type' => 'textfield',
  
'#title' => t('Default total file size per user'),
  
'#default_value' => $upload_usersize_default,
  
'#size' => 5,
  
'#maxlength' => 5,
  
'#description' => t('The default maximum size of all files a user can have on the site.'),
  
'#field_suffix' => t('MB')
);
?>

#group

Used by: fieldset

Description: Specifies a group that can be used to group fieldsets into vertical tabs.

Values: A string where the value is used for the id of a form element with the #type of vertical_tabs.

Usage example (user.admin.inc):

<?php
$form
['email'] = array(
  
'#type' => 'vertical_tabs',
);
...
$form['email_admin_created'] = array(
  
'#type' => 'fieldset',
  
'#title' => t('Welcome (new user created by administrator)'),
  
'#collapsible' => TRUE,
  
'#collapsed' => (variable_get('user_register', 1) != 0),
  
'#description' => t('Edit the welcome e-mail messages sent to new member accounts created by an administrator.'),
  
'#group' => 'email'
);
?>

#header

Used by: tableselect

Description: Column headers.

Values: Associative array where the keys are the field names to use for each column, and the values are the translated text to display for each column header.

#id

Description: Internal. Used to populate form elements' id property. In rare cases, you can set this value yourself on a form element, to override the default setting.

Value: HTML id string.

#input

INTERNAL. Indicates whether or not input is possible for this form element.

#js_select

Used by: tableselect

Description: Whether to include a select all checkbox.

Values: TRUE to add a select all box to each row of the table, FALSE to omit the select all box. Only applies if #multiple is also TRUE.

#limit_validation_errors

Used by: button, image_button, submit

Description: Provides an array of sections which are parts of $form_state['values'] which should be validated, implying that sections which are not listed should not be validated. This is normally used in multistep forms in the case of a "back" button, for example, where '#limit_validation_errors' => array() would mean not to validate anything as form values on the current page are to be discarded anyway. #limit_validation_errors does not have any effect if #submit is not set. More discussion is in the form_set_error() documentation.

Values: array indicating sections of the $form_state['values'] which should be validated.

#markup

Used by: item, markup

Description: Used to set HTML that will be output on the form.

Values: Text (valid HTML)

Usage example (contact.module):

<?php
  $form
['from'] = array(
   
'#type' => 'item',
   
'#title' => t('From'),
   
'#markup' => check_plain($user->name) . ' &lt;' . check_plain($user->mail) . '&gt;',
  );
?>

#maxlength

Used by: password, textfield

Description: The maximum amount of characters to accept as input.

Values: A positive number.

Usage example (forum.module):

<?php
$form
['title'] = array(
 
'#type' => 'textfield',
  '#title'
=> t('Subject'),
  '#default_value'
=> $node->title,
  '#size'
=> 60,
  '#maxlength'
=> 128,
  '#required'
=> TRUE,
);
?>

#method

Used by: form

Description: The HTTP method with which the form will be submitted.

Values: get or post. Default is post.

Usage example (node.module):

<?php
$form
['#method'] = 'post';
?>

#multiple

Used by: select, tableselect

Description: Indicates whether the user may select more than one item.

Values: TRUE or FALSE

Usage example (taxonomy.module):

<?php
return array(
  '#type'
=> 'select',
  '#title'
=> $title,
  '#default_value'
=> $value,
  '#options'
=> $options,
  '#description'
=> $description,
  '#multiple'
=> $multiple,
  '#size'
=> $multiple ? min(12, count($options)) : 0,
  
'#weight' => -15,
);
?>

#name

Used by: button, submit, file

Description: The name attribute of the corresponding HTML element. This can be used in element types such as submit, button and file to override the default setting.

Values: String.

#options

Used by: checkboxes, radios, select, tableselect

Description: Selectable options for a form element that allows multiple choices.

Values: An array in the form of array(t('Display value 1'), t('Display value 2')) or array('return_value1' => t('Display Value 1'), 'return_value2' => t('Display Value 2')) if specific return values are required. If returned values are identical to displayed values, you can use drupal_map_assoc() as in the example below. The #options property needs special handling for checkboxes, and works completely differently for tableselect. See the respective element descriptions for details.

Usage example (form_example_states.inc):

<?php
  $form
['undergraduate']['school_country'] = array(
    
'#type' => 'select',
    
'#options' => drupal_map_assoc(array(t('UK'), t('Other'))),
    
'#title' => t('In what country is your college or university located?'),
  );
?>

#parents

Used by: All

Description: Identifies parent form elements. See #tree and #parents in the handbook and the complete comparison between #parents and #array_parents.

Values: An array of element names.

Usage example (comment.module):

<?php
$form
['admin']['status'] = array(
 
'#type' => 'radios',
  '#parents'
=> array('status'),
  '#title'
=> t('Status'),
  '#default_value'
=> $status,
  '#options'
=> array(t('Published'), t('Not published')),
  '#weight'
=> -1,
);
?>

#post_render

Used by: All elements and forms

Description: Function(s) to call after rendering in drupal_render() has occured. The named function is called with two arguments, the rendered element and its children. It returns the (potentially) altered) element content.

Values: An array of function names to call.

Usage example:

Note: If you are altering an existing form via hook_form_alter() or a similar means, be careful with this property! You will probably want to add to the existing array rather than writing over it, so don't follow this usage example exactly.

<?php
$form
['admin']['#post_render'] = array('admin_form_html_cleanup');
?>

This example would call admin_form_html_cleanup($content, $element) after $element has been rendered to $content via drupal_render(). $content may then be modified and must be returned.

#prefix

Used by: All elements and forms.

Description: Text or markup to include before the form element. Also see #suffix.

Values: Mixed

Usage example (poll.module):

<?php
$form
['choice'] = array(
  '#type'
=> 'fieldset',
  '#title'
=> t('Choices'),
  '#prefix'
=> '<div class="poll-form">',
  '#suffix'
=> '</div>',
  '#tree'
=> TRUE,
);
?>

#pre_render

Used by: All elements and forms.

Description: Function(s) to call before rendering in drupal_render() has occured. The function(s) provided in #pre_render receive the element as an argument and must return the altered element.

Values: An array of function names to call.

Usage example (filter.module):

Note: If you are altering an existing form via hook_form_alter() or a similar means, be careful with this property! As demonstrated here, you will probably want to add to the existing array rather than writing over it.

// Prepend #pre_render callback to replace field value with user notice
// prior to rendering.
if (!isset($element['value']['#pre_render'])) {
  $element['value']['#pre_render'] = array();
}
array_unshift($element['value']['#pre_render'], 'filter_form_access_denied');

...
function filter_form_access_denied($element) {
  $element['#value'] = t('This field has been disabled because you do not have sufficient permissions to edit it.');
  return $element;
}

This example would call filter_form_access_denied($element) before the $element has been rendered via drupal_render(). $element may then be modified and is returned for rendering.

#printed

INTERNAL. Used to determine whether or not a form element has been printed yet.

#process

Used by: All

Description: An array of functions that are called when an element is processed. Using this callback, modules can "register" further actions. For example, the "radios" form type is expanded to multiple radio buttons using a processing function.

Values: Array of function names (strings)

Usage example (system.module) in system_element_info():

Note: If you are altering an existing form via hook_form_alter() or a similar means, be careful with this property! You will probably want to add to the existing array rather than writing over it, so don't follow this usage example exactly.

<?php
$types
['radios'] = array(
'#input' => TRUE,
'#process' => array('form_process_radios'),
'#theme_wrappers' => array('radios'),
'#pre_render' => array('form_pre_render_conditional_form_element'),
);
?>

In this example, the function form_process_radios is called; the entire radios element is passed in as the argument. This function expands a radios element into individual radio buttons.

#processed

INTERNAL. Used to ascertain whether or not a form element has been processed (ie: expanded to multiple elements).

#required

Used by: checkbox, checkboxes, date, file, password, password_confirm, radio, radios, select, text_format, textarea, textfield, weight

Description: Indicates whether or not the element is required. This automatically validates for empty fields, and flags inputs as required. File fields are NOT allowed to be required.

Values: TRUE or FALSE

Usage example (forum.module):

<?php
$form
['title'] = array(
 
'#type' => 'textfield',
  '#title'
=> t('Subject'),
  '#default_value'
=> $node->title,
  '#size'
=> 60,
  '#maxlength'
=> 128,
  '#required'
=> TRUE,
);
?>

#resizable

Used by: text_format, textarea

Description: Whether users should be allowed to resize the text area

Values: TRUE or FALSE

#return_value

Used by: checkbox, image_button, radio

Description: Value element should return when selected

Values: Mixed

Usage example (poll.module):

<?php
$form
['morechoices'] = array(
  
'#type' => 'checkbox',
  '#title'
=> t('Need more choices'),
  '#return_value'
=> 1,
  '#default_value'
=> 0,
  '#description'
=> t("If the amount of boxes above isn't enough, check this box and click the Preview button below to add some more."),
);
?>

#rows

Used by: text_format, textarea

Description: How many rows high the textarea should be (see also #cols)

Values: A positive number

Usage example (aggregator.module):

<?php
$form
['description'] = array(
  
'#type' => 'textarea',
  '#title'
=> t('Description'),
  '#default_value'
=> $edit['description'],
  '#cols'
=> 60,
  '#rows'
=> 5,
);
?>

#size

Used by: file, password, password_confirm, select, textfield

Description: Width of the textfield (in characters) or size of multiselect box (in lines).

Values: A positive number.

Usage example (comment.module):

<?php
        $form
['admin']['homepage'] = array(
         
'#type'=> 'textfield',
         
'#title'=> t('Homepage'),
         
'#maxlength'=> 255,
         
'#size'=> 30,
         
'#default_value'=> $edit['homepage'],
        );
?>

#src

Used by: image_button

Description:  The URL of the image of the button.

Values: A URL.

#states

Used by: any element

Description:  Adds JavaScript to the element to allow it to have different active states.

Values: A structured array describing the different JavaScript states that can be applied to the element when certain conditions are met. Please read the extensive description of this feature at drupal_process_states().

Usage example

$form['email_canceled']['settings'] = array(
    '#type' => 'container',
    '#states' => array(
      // Hide the settings when the cancel notify checkbox is disabled.
      'invisible' => array(
       ':input[name="email_canceled_toggle"]' => array('checked' => FALSE),
      ),
    ),
  );

#submit

Used by: button, image_button, submit, form

Description:  A list of custom submit functions that will be called when the element is submitted. This is usually to add additional submit functions to a form, or to use an alternate function rather than the default form submission function which is the form ID with _submit appended to it.

Values: An array of function names. Each such function will take $form and $form_state as parameters.

Usage example (node_form()):

if (!empty($node->nid) && node_access('delete', $node)) {
 $form['actions']['delete'] = array(
  '#type' => 'submit',
  '#value' => t('Delete'),
  '#weight' => 15,
  '#submit' => array('node_form_delete_submit'),
 );

#suffix

Used by: All elements and forms.

Description: Text or markup to include after the form element. Also see #prefix.

Values: Mixed

Usage example (poll.module):

<?php
$form
['choice'] = array(
  '#type'
=> 'fieldset',
  '#title'
=> t('Choices'),
  '#prefix'
=> '<div class="poll-form">',
  '#suffix'
=> '</div>',
  '#tree'
=> TRUE,
);
?>

#theme

Used by: All elements and forms.

Description: Theme function to call for element. It must render this element and all of its child elements.

Values: The name of a theme function, without the initial 'theme_'.

Usage example (node.module):

<?php
$data
['actions']['output'][] = array(
       
'#theme' => 'menu_local_action',
       
'#link' => $item,
      );
?>

#theme_wrappers

Used by: All elements and forms.

Description: Theme function to call for element, after the element and children are rendered, but before the #post_render functions are called.

Values: The name of a theme function, without the initial 'theme_'.

Usage example (system.module from definition of default properties for a form):

<?php
$type['form'] = array('#theme_wrappers' => array('form'));
?>

#title

Used by: checkbox, checkboxes, date, fieldset, file, item, password, password_confirm, radio, radios, select, text_format, textarea, textfield, weight

Description: The title of the form element. Make sure to enclose inside the t() function so this property can be translated.

Values: Mixed

Usage example (aggregator.module):

<?php
$form
['description'] = array(
  
'#type' => 'textarea',
  '#title'
=> t('Description'),
  '#default_value'
=> $edit['description'],
  '#cols'
=> 60,
  '#rows'
=> 5,
);
?>

#title_display

Used by: checkbox, checkboxes, date, fieldset, file, item, password, password_confirm, radio, radios, select, text_format, textarea, textfield, weight

Description: Indicates how the label should be rendered. The label includes the #title and the required marker, if #required. If the #title is empty but the field is #required, the label will contain only the required marker.

Values: String.

Possible values:

  • before: The label is output before the element. This is the default for most elements.
  • after: The label is output after the element. For example, this is used for radio and checkbox #type elements as set in system_elements().
  • invisible: #title is rendered as a label element before the form element in the page markup, and is made invisible with the Drupal 7 .element-invisible system CSS class (system.base.css). This makes #title remain available to screen-reader users, but hides it from being displayed visually in the browser.
  • attribute: Set the title attribute on the element to create a tooltip but output no label element. This is supported only for checkboxes and radios in form_pre_render_conditional_form_element(). It is used where a visual label is not needed, such as a table of checkboxes where the row and column provide the context. The tooltip will include the title and required marker.

Usage example (block.module):

<?php
$form
['blocks'][$key]['weight'] = array(
 '#type' => 'weight',
 '#default_value' => $block['weight'],
 '#delta' => $weight_delta,
 '#title_display' => 'invisible',
 '#title' => t('Weight for @block block', array('@block' => $block['info'])),
);

?>

#tree

Used by: All

Description: Used to allow collections of form elements. Normally applied to the "parent" element, as the #tree property cascades to sub-elements. Use where you previously used ][ in form_ calls. For more information, see #tree and #parents in the handbook.

Values: TRUE or FALSE

Usage example (system.module):

<?php
$form
['status'] = array(
  '#type'
=> 'checkboxes',
  '#default_value'
=> $status,
  '#options'
=> $options,
  '#tree'
=> TRUE,
);
$required = array('block', 'filter', 'system', 'user', 'watchdog');
foreach (
$required as $require) {
  $form['status'][$require] = array(
    '#type'
=> 'hidden',
    '#value'
=> 1,
    '#suffix'
=> t('required'),
  );
}
?>

#type

Used by: All

Description: Used to determine the type of form element.

Values: button, checkbox, checkboxes, date, fieldset, file, form, hidden, image_button, item, machine_name, markup, password, password_confirm, radio, radios, select, submit, tableselect, textarea, textfield, token, value, vertical_tabs, weight

Usage example (locale.module):

<?php
$form
['submit'] = array('#type' => 'submit', '#value' => t('Import'));
?>

#validate

Used by: button, image_button, form, submit

Description: A list of custom validation functions that need to be passed.This is usually used to add additional validation functions to a form, or to use an alternate function rather than the default form validation function which is the form ID with _validate appended to it.

Values: An array of function names. Each such function will take $form and $form_state as parameters and should use form_set_error() if the form values do not pass validation. For example:

function test_form_validate($form, &$form_state) {
  if (
$form_state['values']['name'] == '') {
    
form_set_error('name', t('You must select a name for this group of settings.'));
  }
}

Usage example (node.module):

Note: If you are altering an existing form via hook_form_alter() or a similar means, be careful with this property! You will probably want to add to the existing array rather than writing over it, so don't follow this usage example exactly.

<?php
   
// Node types:
   
$types = array_map('check_plain', node_get_types('names'));
   
$form['advanced']['type'] = array(
     
'#type' => 'checkboxes',
     
'#title' => t('Only of the type(s)'),
     
'#prefix' => '<div class="criterion">',
     
'#suffix' => '</div>',
     
'#options' => $types,
    );
   
$form['advanced']['submit'] = array(
     
'#type' => 'submit',
     
'#value' => t('Advanced search'),
     
'#prefix' => '<div class="action">',
     
'#suffix' => '</div>',
    );

   
$form['#validate'][] = 'node_search_validate';
?>

#validation_arguments

INTERNAL

#value

Used by: button, hidden, image_button, submit, token, value

Description: Used to set values that cannot be edited by the user. Should NOT be confused with #default_value, which is for form inputs where users can override the default value.

Values: Mixed (text or numbers)

Usage example (locale.module):

<?php
$form
['submit'] = array('#type' => 'submit', '#value' => t('Import'));
?>

#value_callback

Used by: All elements.

Description: Specifies the name of a custom value function that implements how user input is mapped to an element's #value property.

Values: A single function name to be called to set the value of this element.

A value function for an element takes $element, $input and $form_state as parameters, and has the form:

<?php
function myelement_value($element, $input = FALSE, $form_state = array()) {
  if (
$input === FALSE) {
    return isset(
$element['#default_value']) ? $element['#default_value'] : 0;
  }
}
?>

Usage example (file.field.inc):

<?php
 
// Essentially we use the managed_file type, extended with some enhancements.
 
$element_info = element_info('managed_file');
 
$element += array(
   
'#type' => 'managed_file',
   
'#default_value' => isset($items[$delta]) ? $items[$delta] : $defaults,
   
'#upload_location' => file_field_widget_uri($field, $instance),
   
'#upload_validators' => file_field_widget_upload_validators($field, $instance),
   
'#value_callback' => 'file_field_widget_value',
   
'#process' => array_merge($element_info['#process'], array('file_field_widget_process')),
   
// Allows this field to return an array instead of a single value.
   
'#extended' => TRUE,
  );
...
function
file_field_widget_value($element, $input = FALSE, $form_state) {
  if (
$input) {
   
// Checkboxes lose their value when empty.
    // If the display field is present make sure its unchecked value is saved.
   
$field = field_widget_field($element, $form_state);
    if (empty(
$input['display'])) {
     
$input['display'] = $field['settings']['display_field'] ? 0 : 1;
    }
  }
?>

#weight

Used by: All elements.

Description: Used to sort the list of form elements before being output; lower numbers appear before higher numbers.

Values: A positive or negative number (integer or decimal).

Usage example (book.module):

<?php
$form
['parent'] = array(
  '#type' => 'select',
  '#title'
=> t('Parent'),
  '#default_value'
=> ($node->parent ? $node->parent : arg(4)),
  '#options'
=> book_toc($node->nid),
  '#weight'
=> -15,
  
'#description' => t('The parent that this page belongs in. Note that pages whose parent is &lt;top-level&gt; are regarded as independent, top-level books.'),
);
?>

File

documentation/developer/topics/forms_api_reference.html
View source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Form API Reference</title>



  <style type="text/css">
/*<![CDATA[*/
h2 {
  border-bottom: 100% dashed 1px;
}
h3 {
  background-color: #dfedf7;
}
td {
  text-align: center;
}
.help {
  background-color: #ffc;
}
.x {
  background-color: #dfedf7;
}
.verified {
  background-color: #CFC;
}

.def-txt {color: #000000}
.r-txt {color: #DD0000}
.g-txt {color: #007700}
.b-txt {color: #0000BB}
.y-txt {color: #FF8000}
/*]]>*/
  </style>
</head><body>

<h1>Form API Reference</h1>

<style type="text/css">
/*<![CDATA[*/
.no-blowout {
	max-width: 960px;
}
/*]]>*/
</style>
<div class="no-blowout">
<p>This document provides a programmer's reference to the Drupal Form API.
For a brief introduction on how to create forms, see the
<a href="http://api.drupal.org/api/drupal/includes!form.inc/group/form_api/7">Form generation guide</a>.
For more extensive information about the Form API, see the
<a href="http://drupal.org/node/37775">Form API handbook</a>.</p>

<p>Skip to: <a href="#properties">Properties</a> | <a href="#element_default_values">Default Values</a> | <a href="#elements">Elements</a></p>
<p>Note that internal properties are not included in the table below, but are included in the Properties list. These include: <a href="#built">#built</a>, <a href="#children">#children</a>, <a href="#error">#error</a>, <a href="#id">#id</a>, <a href="#input">#input</a>, <a href="#printed">#printed</a>, <a href="#validation">#validation_arguments</a></p>

<h2>Form Controls</h2>

<p><strong>Legend:</strong><br />
<strong>X</strong> = attribute can be used with this type<br />
<strong>-</strong> = attribute is not applicable to this type</p>
</div>
<table border="1">

  <tbody>
    <tr>
      <th scope="col"><a href="#type"><strong>#type</strong></a></th>
      <th scope="col"><a href="#checkbox">checkbox</a></th>
      <th scope="col"><a href="#checkboxes">checkboxes</a></th>
      <th scope="col"><a href="#date">date</a></th>
      <th scope="col"><a href="#fieldset">fieldset</a></th>
      <th scope="col"><a href="#file">file</a></th>
      <th scope="col"><a href="#machine_name">machine_name</a></th>
      <th scope="col"><a href="#managed_file">managed_file</a></th>
      <th scope="col"><a href="#password">password</a></th>
      <th scope="col"><a href="#password_confirm">password_confirm</a></th>
      <th scope="col"><a href="#radio">radio</a></th>
      <th scope="col"><a href="#radios">radios</a></th>
      <th scope="col"><a href="#select">select</a></th>
      <th scope="col"><a href="#tableselect">tableselect</a></th>
      <th scope="col"><a href="#text_format">text_format</a></th>
      <th scope="col"><a href="#textarea">textarea</a></th>
      <th scope="col"><a href="#textfield">textfield</a></th>
      <th scope="col"><a href="#vertical_tabs">vertical_tabs</a></th>
      <th scope="col"><a href="#weight">weight</a></th>
    </tr>
    <tr>
      <th scope="row"><a href="#access">#access</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date -->  <td class="x"><strong>X</strong></td>
<!-- fieldset --><td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --><td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
      <th scope="row"><a href="#access">#access</a></th> </tr>
    <tr>
      <th scope="row"><a href="#after_build">#after_build</a></th>
<!-- checkbox -->      <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date -->  <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --><td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
      <th scope="row"><a href="#after_build">#after_build</a></th></tr>
    <tr>
      <th scope="row"><a href="#ajax">#ajax</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td>-</td>
<!-- fieldset --><td>-</td>
<!-- file -->  <td>-</td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#ajax">#ajax</a></th></tr>

    <tr>
      <th scope="row"><a href="#array_parents">#array_parents</a></th>
<!-- checkbox -->       <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --><td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --><td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield -->  <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --><td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#array_parents">#array_parents</a></th>
 </tr>
    <tr>
      <th scope="row"><a href="#attached">#attached</a></th>
<!-- checkbox -->       <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#attached">#attached</a></th>
</tr>
    <tr>
      <th scope="row"><a href="#attributes">#attributes</a></th>
<!-- checkbox -->       <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#attributes">#attributes</a></th></tr>
    <tr>
      <th scope="row"><a href="#autocomplete_path">#autocomplete_path</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#autocomplete_path">#autocomplete_path</a></th></tr>
    <tr>
      <th scope="row"><a href="#collapsed">#collapsed</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#collapsed">#collapsed</a></th></tr>
    <tr>
      <th scope="row"><a href="#collapsible">#collapsible</a></th>
<!-- checkbox -->       <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#collapsible">#collapsible</a></th></tr>
    <tr>
      <th scope="row"><a href="#cols">#cols</a></th>
<!-- checkbox -->       <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#cols">#cols</a></th></tr>
    <tr>
      <th scope="row"><a href="#default_tab">#default_tab</a></th>
<!-- checkbox -->       <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#default_tab">#default_tab</a></th></tr>
    <tr>
      <th scope="row"><a href="#default_value">#default_value</a></th>
<!-- checkbox -->       <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --><td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#default_value">#default_value</a></th></tr>
    <tr>
      <th scope="row"><a href="#delta">#delta</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#delta">#delta</a></th></tr>
    <tr>
      <th scope="row"><a href="#description">#description</a></th>
<!-- checkbox -->      <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date -->  <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --><td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --><td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios -->  <td class="x"><strong>X</strong></td>
<!-- select --><td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#description">#description</a></th> </tr>
    <tr>
      <th scope="row"><a href="#disabled">#disabled</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td><strong>-</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#disabled">#disabled</a></th></tr>
    <tr>
      <th scope="row"><a href="#element_validate">#element_validate</a></th>
<!-- checkbox -->       <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#element_validate">#element_validate</a></th></tr>
    <tr>
      <th scope="row"><a href="#empty">#empty</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#empty">#empty</a></th></tr>
    <tr>
    <th scope="row"><a href="#empty_option">#empty_option</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --><td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#empty_option">#empty_option</a></th></tr>
     <tr>
      <th scope="row"><a href="#empty_value">#empty_value</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --><td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#empty_value">#empty_value</a></th></tr>
    <tr>
      <th scope="row"><a href="#field_prefix">#field_prefix</a></th>
<!-- checkbox --><td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td>-</td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#field_prefix">#field_prefix</a></th></tr>
    <tr>
      <th scope="row"><a href="#field_suffix">#field_suffix</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td>-</td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#field_suffix">#field_suffix</a></th></tr>
    <tr>
      <th scope="row"><a href="#group">#group</a></th>
<!-- checkbox -->  <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#group">#group</a></th></tr>
    <tr>
      <th scope="row"><a href="#header_prop">#header</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#header_prop">#header</a></th></tr>
    <tr>
      <th scope="col"><a href="#type"><strong>#type</strong></a></th>
      <th scope="col"><a href="#checkbox">checkbox</a></th>
      <th scope="col"><a href="#checkboxes">checkboxes</a></th>
      <th scope="col"><a href="#date">date</a></th>
      <th scope="col"><a href="#fieldset">fieldset</a></th>
      <th scope="col"><a href="#file">file</a></th>
      <th scope="col"><a href="#machine_name">machine_name</a></th>
      <th scope="col"><a href="#managed_file">managed_file</a></th>
      <th scope="col"><a href="#password">password</a></th>
      <th scope="col"><a href="#password_confirm">password_confirm</a></th>
      <th scope="col"><a href="#radio">radio</a></th>
      <th scope="col"><a href="#radios">radios</a></th>
      <th scope="col"><a href="#select">select</a></th>
      <th scope="col"><a href="#tableselect">tableselect</a></th>
      <th scope="col"><a href="#text_format">text_format</a></th>
      <th scope="col"><a href="#textarea">textarea</a></th>
      <th scope="col"><a href="#textfield">textfield</a></th>
      <th scope="col"><a href="#vertical_tabs">vertical_tabs</a></th>
      <th scope="col"><a href="#weight">weight</a></th>
      <th scope="col"><a href="#type"><strong>#type</strong></a></th>
    </tr>
    <tr>
      <th scope="row"><a href="#js_select">#js_select</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#js_select">#js_select</a></th></tr>
    <tr>
      <th scope="row"><a href="#maxlength">#maxlength</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#maxlength">#maxlength</a></th></tr>
    <tr>
      <th scope="row"><a href="#multiple">#multiple</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#multiple">#multiple</a></th></tr>
    <tr>
      <th scope="row"><a href="#options">#options</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#options">#options</a></th></tr>
    <tr>
      <th scope="row"><a href="#parents">#parents</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#parents">#parents</a></th></tr>
    <tr>
      <th scope="row"><a href="#post_render">#post_render</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#post_render">#post_render</a></th></tr>
    <tr>
      <th scope="row"><a href="#prefix">#prefix</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#prefix">#prefix</a></th></tr>
    <tr>
      <th scope="row"><a href="#pre_render">#pre_render</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#pre_render">#pre_render</a></th></tr>
    <tr>
      <th scope="row"><a href="#process">#process</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#process">#process</a></th></tr>
    <tr>
      <th scope="row"><a href="#required">#required</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#required">#required</a></th></tr>
    <tr>
      <th scope="row"><a href="#resizable">#resizable</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#resizable">#resizable</a></th></tr>
    <tr>
      <th scope="row"><a href="#return_value">#return_value</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#return_value">#return_value</a></th></tr>
    <tr>
      <th scope="row"><a href="#rows">#rows</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td>-</td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#rows">#rows</a></th></tr>
    <tr>
      <th scope="row"><a href="#size">#size</a></th>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td>-</td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td>-</td>
<th scope="row"><a href="#size">#size</a></th></tr>
    <tr>
      <th scope="row"><a href="#states">#states</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#states">#states</a></th></tr>
    <tr>
      <th scope="row"><a href="#suffix">#suffix</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#suffix">#suffix</a></th></tr>
    <tr>
      <th scope="row"><a href="#theme">#theme</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#theme">#theme</a></th></tr>
    <tr>
      <th scope="row"><a href="#theme_wrappers">#theme_wrappers</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#theme_wrappers">#theme_wrappers</a></th></tr>
    <tr>
      <th scope="row"><a href="#title"><strong>#title</strong></a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#title"><strong>#title</strong></a></th></tr>
    <tr>
      <th scope="row"><a href="#title_display">#title_display</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#title_display">#title_display</a></th></tr>
    <tr>
      <th scope="row"><a href="#tree">#tree</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#tree">#tree</a></th></tr>
<tr>
      <th scope="row"><a href="#value_callback">#value_callback</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#value_callback">#value_callback</a></th>
</tr>
    <tr>
      <th scope="row"><a href="#weightval">#weight</a></th>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td class="x"><strong>X</strong></td>
<!-- fieldset --> <td class="x"><strong>X</strong></td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td class="x"><strong>X</strong></td>
<!-- managed_file --> <td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td class="x"><strong>X</strong></td>
<!-- radio --> <td class="x"><strong>X</strong></td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- text_format --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> <td class="x"><strong>X</strong></td>
<th scope="row"><a href="#weightval">#weight</a></th></tr>
  </tbody>
</table>

<h2>Special Elements</h2>

<table border="1">

  <tbody>
    <tr>
      <th scope="col"><a href="#type">#</a><a href="#type">type</a></th>
      <th scope="col"><a href="#actions">actions</a></th>
      <th scope="col"><a href="#button">button</a></th>
      <th scope="col"><a href="#container">container</a></th>
      <th scope="col"><a href="#image_button">image_button</a></th>
      <th scope="col"><a href="#submit">submit</a></th>
      <th scope="col"><a href="#form">form</a></th>
      <th scope="col"><a href="#hidden">hidden</a></th>
      <th scope="col"><a href="#token">token</a></th>
      <th scope="col"><a href="#markup">markup</a></th>
      <th scope="col"><a href="#item">item</a></th>
      <th scope="col"><a href="#val">value</a></th>
    </tr>
    <tr>
      <th scope="row"><a href="#access">#access</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#action">#action</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td>-</td>
<!-- container --> <td>-</td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td>-</td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#after_build">#after_build</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#ajax">#ajax</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td>-</td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#attributes">#attributes</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#button_type">#button_type</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td>-</td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#default_value">#default_value</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td>-</td>
<!-- container --> <td>-</td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td>-</td>
<!-- form --> <td>-</td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#description">#description</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td>-</td>
<!-- container --> <td>-</td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td>-</td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#disabled">#disabled</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td>-</td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#element_validate">#element_validate</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td>-</td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td>-</td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#executes_submit_callback">#executes_submit_callback</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td>-</td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#limit_validation_errors">#limit_validation_errors</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td>-</td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#markup-attribute">#markup</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td>-</td>
<!-- container --> <td>-</td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td>-</td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#method">#method</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td>-</td>
<!-- container --> <td>-</td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td>-</td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#name">#name</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td>-</td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#parents">#parents</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td>-</td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#post_render">#post_render</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#prefix">#prefix</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#pre_render">#pre_render</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#process">#process</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#return_value">#return_value</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td>-</td>
<!-- container --> <td>-</td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td>-</td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#src">#src</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td>-</td>
<!-- container --> <td>-</td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td>-</td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#submit_property">#submit</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td>-</td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#suffix">#suffix</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#theme">#theme</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#theme_wrappers">#theme_wrappers</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#title"><strong>#title</strong></a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td>-</td>
<!-- container --> <td>-</td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td>-</td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#title_display">#title_display</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td>-</td>
<!-- container --> <td>-</td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td>-</td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#tree">#tree</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#validate">#validate</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td>-</td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="row"><a href="#value">#value</a></th>
<!-- actions --> <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td>-</td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td>-</td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> <td class="x"><strong>X</strong></td>
</tr>
    <tr>
      <th scope="row"><a href="#weightval">#weight</a></th>
<!-- actions --> <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- container --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td class="x"><strong>X</strong></td>
<!-- form --> <td>-</td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> <td>-</td>
</tr>
    <tr>
      <th scope="col"><a href="#type">#</a><a href="#type">type</a></th>
      <th scope="col"><a href="#actions">actions</a></th>
      <th scope="col"><a href="#button">button</a></th>
      <th scope="col"><a href="#container">container</a></th>
      <th scope="col"><a href="#image_button">image_button</a></th>
      <th scope="col"><a href="#submit">submit</a></th>
      <th scope="col"><a href="#form">form</a></th>
      <th scope="col"><a href="#hidden">hidden</a></th>
      <th scope="col"><a href="#token">token</a></th>
      <th scope="col"><a href="#markup">markup</a></th>
      <th scope="col"><a href="#item">item</a></th>
      <th scope="col"><a href="#val">value</a></th>
    </tr>
  </tbody>
</table>
<div class="no-blowout">
<h2><a name="element_default_values" id="element_default_values">Default
Values</a></h2>

<p>Every
element automatically has these default values (see
system_element_info()):</p>

<ul>

  <li><a href="#description">#description</a> = NULL</li>
  <li><a href="#attributes">#attributes</a> = array()</li>
  <li><a href="#required">#required</a> = FALSE</li>
  <li><a href="#tree">#tree</a> = FALSE</li>
  <li><a href="#parents">#parents</a> = array()</li>
</ul>

<p>The following is a list of default values which do not need to be
set (found in system_element_info):</p>

<ul>

  <li> <strong><a href="#button">button</a></strong>
    <ul>
      <li><a href="#name">#name</a> = 'op'</li>
      <li><a href="#button_type">#button_type</a> = 'submit'</li>
      <li><a href="#executes_submit_callback">#executes_submit_callback</a>
= FALSE</li>
      <li><a href="#ajax_event">#ajax['event']</a> = 'mousedown' </li>
    </ul>
  </li>
  <li> <strong><a href="#checkbox">checkbox</a></strong>
    <ul>
      <li><a href="#return_value">#return_value</a> = 1</li>
      <li><a href="#ajax_event">#ajax['event']</a> = 'change' </li>
      <li><a href="#title_display">#title_display</a> = 'after' </li>
    </ul>
  </li>
  <li> <strong><a href="#checkboxes">checkboxes</a></strong>
    <ul>
      <li><a href="#tree">#tree</a> = TRUE</li>
    </ul>
  </li>
  <li> <a href="#fieldset"><strong>fieldset</strong></a>
    <ul>
      <li><a href="#collapsible">#collapsible</a> = FALSE</li>
      <li><a href="#collapsed">#collapsed</a> = FALSE</li>
    </ul>
  </li>
  <li> <strong><a href="#file">file</a></strong>
    <ul>
      <li><a href="#size">#size</a> = 60</li>
    </ul>
  </li>
  <li><strong><a href="#form">form</a></strong></li>
  <li style="list-style-type: none; list-style-image: none; list-style-position: outside;">
    <ul>
      <li><a href="#method">#method</a> = 'post'</li>
      <li><a href="#action">#action</a> = request_uri()</li>
    </ul>
  </li>
  <li> <strong><a href="#image_button">image_button</a></strong>
    <ul>
      <li><a href="#button_type">#button_type</a> = 'submit'</li>
      <li><a href="#executes_submit_callback">#executes_submit_callback</a>
= TRUE</li>
      <li><a href="#ajax_event">#ajax['event']</a> = 'mousedown' </li>
    </ul>
  </li>
  <li><strong><a href="#radio">radio</a></strong></li>
  <li style="list-style-type: none; list-style-image: none; list-style-position: outside;">
    <ul>
      <li><a href="#ajax_event">#ajax['event']</a> = 'change' </li>
      <li><a href="#title_display">#title_display</a> = 'after' </li>
    </ul>
  </li>
  <li><strong><a href="#password">password</a></strong></li>
  <li style="list-style-type: none; list-style-image: none; list-style-position: outside;">
    <ul>
      <li><a href="#size">#size</a> = 60</li>
      <li><a href="#maxlength">#maxlength</a> = 128</li>
      <li><a href="#ajax_event">#ajax['event']</a> = 'blur' </li>
    </ul>
  </li>
  <li><strong><a href="#password_confirm">password_confirm</a></strong></li>
  <li style="list-style-type: none; list-style-image: none; list-style-position: outside;">
    <ul>
      <li><a href="#size">#size</a> = 60</li>
    </ul>
  </li>
  <li><strong><a href="#submit">submit</a></strong></li>
  <li style="list-style-type: none; list-style-image: none; list-style-position: outside;">
    <ul>
      <li><a href="#name">#name</a> = 'op'</li>
      <li><a href="#button_type">#button_type</a> = 'submit'</li>
      <li><a href="#executes_submit_callback">#executes_submit_callback</a>
= TRUE</li>
      <li><a href="#ajax_event">#ajax['event']</a> = 'mousedown' </li>
    </ul>
  </li>
  <li> <strong><a href="#textarea">textarea</a></strong>
    <ul>
      <li><a href="#cols">#cols</a> = 60</li>
      <li><a href="#resizable">#resizable</a> = TRUE</li>
      <li><a href="#rows">#rows</a> = 5</li>
      <li><a href="#ajax_event">#ajax['event']</a> = 'blur' </li>
    </ul>
  </li>
  <li><strong><a href="#textfield">textfield</a></strong></li>
  <li style="list-style-type: none; list-style-image: none; list-style-position: outside;">
    <ul>
      <li><a href="#size">#size</a> = 60</li>
      <li><a href="#maxlength">#maxlength</a> = 128</li>
      <li><a href="#autocomplete_path">#autocomplete_path</a> = FALSE</li>
      <li><a href="#ajax_event">#ajax['event']</a> = 'blur' </li>
    </ul>
  </li>
  <li> <strong><a href="#weight">weight</a></strong>
    <ul>
      <li><a href="#delta">#delta</a> = 10</li>
    </ul>
  </li>
</ul>

<p>&nbsp;</p>

<h2><a name="elements" id="elements">Elements</a></h2>

<p>Note that property names in <strong>bold</strong>
are those that will generally need to be defined when creating this
form element. Default values are indicated in parentheses next to
property names, if they exist.</p>

<h3><a name="actions" id="actions">actions</a></h3>

<p><strong>Description</strong>:
A wrapper element to group one or more buttons in a form. Use of the 'actions' element
as an array key helps to ensure proper styling in themes and to enable other
modules to properly alter a form's actions.
</p>

<p><strong>Properties</strong>:
<a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#attributes"><strong>#attributes</strong></a>
<a href="#children">#children</a>, <a href="#id">#id</a>, <a href="#parents">#parents</a>, <a href="#post_render">#post_render</a>, <a href="#pre_render">#pre_render</a>,
<a href="#prefix">#prefix</a>, <a href="#process">#process</a>, <a href="#states">#states</a>, <a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#tree">#tree</a>, <a href="#type">#type</a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example:</strong></p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp; $form</span><span style="color: #007700">[</span><span style="color: #DD0000">'actions'</span><span style="color: #007700">] = array(</span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'actions'</span><span style="color: #007700">);<br />&nbsp; </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'actions'</span><span style="color: #007700">][</span><span style="color: #DD0000">'submit'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'submit'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#value' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Save'</span><span style="color: #007700">),<br />&nbsp; );<br />&nbsp; </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'actions'</span><span style="color: #007700">][</span><span style="color: #DD0000">'delete'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'button'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#value' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Delete'</span><span style="color: #007700">),<br />&nbsp; );<br />&nbsp; </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'actions'</span><span style="color: #007700">][</span><span style="color: #DD0000">'cancel'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#markup' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">l</span><span style="color: #007700">(</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Cancel'</span><span style="color: #007700">), </span><span style="color: #DD0000">'foo/bar'</span><span style="color: #007700">),<br />&nbsp; );<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="button" id="button">button</a></h3>

<p><strong>Description</strong>:
Format an action button. When the button is pressed, the form will be
submitted to Drupal, where it is validated and rebuilt. The submit
handler is not invoked.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#button_type">#button_type</a>
(default: submit), <a href="#disabled">#disabled</a>, <a href="#element_validate">#element_validate</a>, <a href="#executes_submit_callback">#executes_submit_callback</a>
(default: FALSE), <a href="#limit_validation_errors">#limit_validation_errors</a>,
<a href="#name">#name</a> (default: op), <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="#submit_property">#submit</a>,
<a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>, <a href="#tree">#tree</a>,
<a href="#type"><strong>#type</strong></a>, <a href="#validate">#validate</a>,
<a href="#value"><strong>#value</strong></a>, <a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/node/node.module">node.module</a>):</p>

<div class="codeblock">
<p><code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'preview'</span><span class="g-txt">] = array(<br />
&nbsp;</span> <span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span>
<span class="r-txt">'button'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Preview'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#weight'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">19,<br />
</span><span class="g-txt">);<br />
</span> <span class="b-txt">?&gt;</span></span></code></p>
</div>

<h3><a name="checkbox" id="checkbox">checkbox</a></h3>

<p><strong>Description</strong>:
Format a checkbox.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>,
<a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>,
<a href="#field_prefix">#field_prefix</a>, <a href="#field_suffix">#field_suffix</a>,
<a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#required">#required</a>, <a href="#return_value"><strong>#return_value</strong></a>
(default: 1), <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>,
<a href="#theme_wrappers">#theme_wrappers</a>, 
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a> (default: after),
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/contact/contact.module">contact.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'copy'</span><span class="g-txt">] = array(<br />
&nbsp;</span> <span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span>
<span class="r-txt">'checkbox'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt; t(</span><span class="r-txt">'Send me a copy.'</span><span class="g-txt">),<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="checkboxes" id="checkboxes">checkboxes</a></h3>

<p><strong>Description</strong>:
Format a set of checkboxes. #options is an associative array, where the
key is the #return_value of the checkbox and the value is displayed.
The #options array cannot have a 0 key, as it would not be possible to
discern checked and unchecked states.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>,
<a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>, <a href="#options"><strong>#options</strong></a>,
<a href="#parents">#parents</a>, <a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="#required">#required</a>, <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>,
<a href="#theme_wrappers">#theme_wrappers</a>, 
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree"><strong>#tree</strong></a> (default: TRUE), <a href="#type"><strong>#type</strong></a>, <a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/examples/form_example--form_example_states.inc">form_example_states.inc</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />  $form</span><span style="color: #007700">[</span><span style="color: #DD0000">'high_school'</span><span style="color: #007700">][</span><span style="color: #DD0000">'tests_taken'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;</span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'checkboxes'</span><span style="color: #007700">,<br />&nbsp;&nbsp;</span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">drupal_map_assoc</span><span style="color: #007700">(array(</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'SAT'</span><span style="color: #007700">), </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'ACT'</span><span style="color: #007700">))),<br />&nbsp;&nbsp;</span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'What standardized tests did you take?'</span><span style="color: #007700">),<br />...<br />    ),<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="container" id="container">container</a></h3>

<p><strong>Description</strong>:
Returns HTML to wrap child elements in a container. Surrounds child elements with a &lt;div&gt; and
adds attributes such as classes or an HTML id.
</p>

<p><strong>Properties</strong>:
<a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#attributes"><strong>#attributes</strong></a>
<a href="#children">#children</a>, <a href="#id">#id</a>, <a href="#parents">#parents</a>, <a href="#post_render">#post_render</a>, <a href="#pre_render">#pre_render</a>,
<a href="#prefix">#prefix</a>, <a href="#process">#process</a>, <a href="#states">#states</a>, <a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#tree">#tree</a>, <a href="#type">#type</a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/drupal/modules--field--field.form.inc">field.form.inc</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp; </span><span style="color: #007700">if (</span><span style="color: #0000BB">$elements</span><span style="color: #007700">) {<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #FF8000">// Also aid in theming of field widgets by rendering a classified<br />&nbsp;&nbsp;&nbsp; // container.<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #0000BB">$addition</span><span style="color: #007700">[</span><span style="color: #0000BB">$field_name</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'container'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#attributes' </span><span style="color: #007700">=&gt; array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'class' </span><span style="color: #007700">=&gt; array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'field-type-' </span><span style="color: #007700">. </span><span style="color: #0000BB">drupal_html_class</span><span style="color: #007700">(</span><span style="color: #0000BB">$field</span><span style="color: #007700">[</span><span style="color: #DD0000">'type'</span><span style="color: #007700">]),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'field-name-' </span><span style="color: #007700">. </span><span style="color: #0000BB">drupal_html_class</span><span style="color: #007700">(</span><span style="color: #0000BB">$field_name</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'field-widget-' </span><span style="color: #007700">. </span><span style="color: #0000BB">drupal_html_class</span><span style="color: #007700">(</span><span style="color: #0000BB">$instance</span><span style="color: #007700">[</span><span style="color: #DD0000">'widget'</span><span style="color: #007700">][</span><span style="color: #DD0000">'type'</span><span style="color: #007700">]),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#weight' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$instance</span><span style="color: #007700">[</span><span style="color: #DD0000">'widget'</span><span style="color: #007700">][</span><span style="color: #DD0000">'weight'</span><span style="color: #007700">],<br />&nbsp;&nbsp;&nbsp; );<br />&nbsp; }<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>


<h3><a name="date" id="date">date</a></h3>

<p><strong>Description</strong>:
Format a date selection box. The #default_value will be today's date if
no value is supplied. The format for the #default_value and the
#return_value is an array with three elements with the keys: 'year',
month', and 'day'. For example, <code><span class="g-txt">array(</span><span class="r-txt">'year'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">2007</span><span class="g-txt">,</span> <span class="r-txt">'month'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">2</span><span class="g-txt">,</span> <span class="r-txt">'day'</span>
<span class="g-txt">=&gt;</span> <span class="b-txt">15</span><span class="g-txt">)</span></code></p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#attributes">#attributes</a>,
<a href="#default_value"><strong>#default_value</strong></a>, <a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>, <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#required">#required</a>, <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/profile/profile.module">profile.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$fields</span><span class="g-txt">[</span><span class="b-txt">$category</span><span class="g-txt">][</span><span class="b-txt">$field</span><span class="g-txt">-&gt;</span><span class="b-txt">name</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;</span><span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'date'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">check_plain</span><span class="g-txt">(</span><span class="b-txt">$field</span><span class="g-txt">-&gt;</span><span class="b-txt">title</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$edit</span><span class="g-txt">[</span><span class="b-txt">$field</span><span class="g-txt">-&gt;</span><span class="b-txt">name</span><span class="g-txt">],</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">_profile_form_explanation</span><span class="g-txt">(</span><span class="b-txt">$field</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#required'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$field</span><span class="g-txt">-&gt;</span><span class="b-txt">required<br />
</span><span class="g-txt">);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="fieldset" id="fieldset">fieldset</a></h3>

<p><strong>Description</strong>:
Format a group of form items.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#attributes">#attributes</a>,
<a href="#collapsed"><strong>#collapsed</strong></a> (default: FALSE), <a href="#collapsible"><strong>#collapsible</strong></a> (default:
FALSE), <a href="#description">#description</a>, <a href="#element_validate">#element_validate</a>, <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/contact/contact.module">contact.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'contact'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp; '#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'fieldset'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Contact
settings'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#weight'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">5</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#collapsible'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#collapsed'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">FALSE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="file" id="file">file</a></h3>

<p><strong>Description</strong>: Format a file upload field.</p>

Note: Drupal will add the code <code>enctype="multipart/form-data"</code>, required by browsers to handle files, so it's not necessary to include it yourself.

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#array_parents">#array_parents</a>, <a href="#attached">#attached</a>, <a href="#attributes">#attributes</a>,
<a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>, <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="required">#required</a>,
<a href="#size"><strong>#size</strong></a> (default: 60), <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/file/file.module">file.module</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'upload'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#name' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'files[' </span><span style="color: #007700">. </span><span style="color: #0000BB">implode</span><span style="color: #007700">(</span><span style="color: #DD0000">'_'</span><span style="color: #007700">, </span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'#parents'</span><span style="color: #007700">]) . </span><span style="color: #DD0000">']'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'file'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Choose a file'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#title_display' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'invisible'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#size' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">22</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#theme_wrappers' </span><span style="color: #007700">=&gt; array(),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#weight' </span><span style="color: #007700">=&gt; -</span><span style="color: #0000BB">10</span><span style="color: #007700">,<br />&nbsp; );<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="form" id="form">form</a></h3>

<p><strong>Description</strong>: A form
containing form elements</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#action">#action</a> (default:
request_uri()), <a href="#after_build">#after_build</a>, <a href="#attributes">#attributes</a>,
<a href="#method">#method</a> (default: 'post'), <a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="#submit_property">#submit</a>,
<a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#tree">#tree</a>, <a href="#validate">#validate</a></p>

<p><strong>Usage example</strong>:</p>

<p>N/A</p>

<h3><a name="hidden" id="hidden">hidden</a></h3>

<p><strong>Description</strong>: Store
data in a hidden form field.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#default_value">#default_value</a>, <a href="#element_validate">#element_validate</a>,
<a href="#parents">#parents</a>, <a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#value"><strong>#value</strong></a>, <a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/block/block.module">block.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'bid'</span><span class="g-txt">] = array(</span><span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'hidden'</span><span class="g-txt">,</span> <span class="r-txt">'#value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$bid</span><span class="g-txt">);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<p>Note that if you plan to use JavaScript to change your <code>hidden</code>
element's value, you will need to use the <code>#default_value</code>
property rather than <code>#value</code>.</p>

<h3><a name="image_button" id="image_button">image_button</a></h3>

<p><strong>Description</strong>:
Format a form submit button with an
image.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>,
<a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#button_type">#button_type</a>
(default: 'submit'), <a href="#disabled">#disabled</a>, <a href="#element_validate">#element_validate</a>, <a href="#executes_submit_callback">#executes_submit_callback</a>
(default: TRUE), <a href="#limit_validation_errors">#limit_validation_errors</a>,
<a href="#parents">#parents</a>, <a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="#return_value">#return_value</a>
(default: TRUE), <a href="#src">#src</a>,
<a href="#submit_property">#submit</a>, <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>,
<a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#validate">#validate</a>, <a href="#value"><strong>#value</strong></a>,
<a href="#weightval">#weight</a></p>

<h3><a name="item" id="item">item</a></h3>

<p><strong>Description</strong>: Generate a
display-only form element
allowing for an optional title and description.</p>

<p>Note: since this is a read-only field,
setting the <a href="#required">#required</a>
property will do nothing except theme the form element to look as if it
were actually required (i.e. by placing a red star next to the <a href="#title">#title</a>).</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#description">#description</a>,
<a href="#element_validate">#element_validate</a>, <a href="#markup-attribute">#markup</a>, <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#required">#required</a>, <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>,
<a href="#type"><strong>#type</strong></a>, <a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/head/file/modules/contact.module">contact.module</a>):</p>

<div class="codeblock">
<p><code><span class="def-txt"><span class="b-txt">&lt;?php<br />
</span></span></code> <span class="b-txt"><code>$form[<span class="r-txt">'from'</span>] = <span class="g-txt">array(</span><br />
&nbsp;&nbsp;</code><code><span class="r-txt">'#type'</span> =&gt; <span class="r-txt">'item'</span>,<br />
&nbsp; <span class="r-txt">'#title'</span> =&gt; t(<span class="r-txt">'From'</span>),<br />
&nbsp; <span class="r-txt">'#markup'</span> =&gt; $user-&gt;name .<span class="r-txt">' &amp;lt;'</span>. $user-&gt;mail .<span class="r-txt">'&amp;gt;'</span>,<br />
<span class="g-txt">);</span></code></span><code><span class="def-txt"><span class="g-txt"><br />
</span> <span class="b-txt">?&gt;</span></span></code></p>
</div>

<h3><a name="machine_name" id="machine_name">machine_name</a></h3>

<p><strong>Description</strong>: Format a single-line text field to store a unique machine-readable name.</p>

<p>Provides a form element to enter a machine name, which is validated to ensure that the name is unique and does not contain disallowed characters. All disallowed characters are replaced with a replacement character via JavaScript.</p>
<p>The element validation checks that the submitted value</p>
<ul>
<li>does not contain the replacement character only</li>
<li>does not contain disallowed characters</li>
<li>is unique; i.e., does not already exist</li>
<li>does not exceed the maximum length (via <a href="#maxlength">#maxlength</a>)</li>
<li>cannot be changed after creation (via <a href="#disabled">#disabled</a>)</li>
</ul>

<p><strong>Non-standard form element properties</strong>:</p>
<ul>
<li>#machine_name: (array) 
  <ul>
    <li>exists: A function name to invoke for checking whether a submitted machine name value already exists. The submitted value is passed as argument. In most cases, an existing API or menu argument function can be re-used. The callback is only invoked, if the submitted value differs from the element's #default_value</li>
    <li>source: (optional) The #array_parents of the form element containing the human-readable name (i.e., as contained in the $form structure) to use as source for the machine name. Defaults to array('name').</li>
    <li>label: (optional) A text to display as label for the machine name value after the human-readable name form element. Defaults to "Machine name".</li>
    <li>replace_pattern: (optional) A regular expression (without delimiters) matching disallowed characters in the machine name. Defaults to '[^a-z0-9_]+'.</li>
    <li>replace: (optional) A character to replace disallowed characters in the machine name via JavaScript. Defaults to '_' (underscore). When using a different character, 'replace_pattern' needs to be set accordingly.</li>
  </ul>
</li>
</ul>

<p><strong>Properties</strong>:
<a href="#access">#access</a>,
<a href="#after_build">#after_build</a>,
<a href="#ajax">#ajax</a>,
<a href="#attributes">#attributes</a>,
<a href="#autocomplete_path">#autocomplete_path</a> (default: FALSE),
<a href="#default_value"><strong>#default_value</strong></a>,
<a href="#description">#description</a> (default: 'A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'),
<a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>,
<a href="#field_prefix">#field_prefix</a>,
<a href="#field_suffix">#field_suffix</a>,
<a href="#maxlength"><strong>#maxlength</strong></a> (default: 64),
<a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>,
<a href="#process">#process</a>,
<a href="#required">#required</a> (default: TRUE),
<a href="#size"><strong>#size</strong></a> (default: 60),
<a href="#states">#states</a>,
<a href="#suffix">#suffix</a>,
<a href="#theme">#theme</a> (default: 'textfield'),
<a href="#theme_wrappers">#theme_wrappers</a> (default: 'form_element'),
<a href="#title"><strong>#title</strong></a> (default: 'Machine-readable name'),
<a href="#title_display">#title_display</a>
<a href="#tree">#tree</a>,
<a href="#type"><strong>#type</strong></a>,
<a href="#weightval">#weight</a>
</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/taxonomy/taxonomy.admin.inc">taxonomy.admin.inc</a>):</p>

<div class="codeblock"><code><span class="def-txt">
  &lt;?php<br />
  <span class="b-txt">$form</span><span class="g-txt">[</span><span class="r-txt">'machine_name'</span><span class="g-txt">]</span> = <span class="g-txt">array(</span><br />
  &nbsp;&nbsp;<span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'machine_name'</span><span class="g-txt">,</span><br />
  &nbsp;&nbsp;<span class="r-txt">'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$vocabulary->machine_name</span><span class="g-txt">,</span><br />
  &nbsp;&nbsp;<span class="r-txt">'#maxlength'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">21</span><span class="g-txt">,</span><br />
  &nbsp;&nbsp;<span class="r-txt">'#machine_name'</span> <span class="g-txt">=&gt;</span> <span class="g-txt">array(</span><br />
  &nbsp;&nbsp;&nbsp;&nbsp;<span class="r-txt">'exists'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'menu_edit_menu_name_exists'</span><span class="g-txt">,</span><br />
  &nbsp;&nbsp;<span class="g-txt">),</span><br />
  <span class="g-txt">);</span><br />
  ?&gt;<br />
</span></code>
</div>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/menu/menu.admin.inc">menu.admin.inc</a>):</p>

<div class="codeblock"><code><span class="def-txt">
  &lt;?php<br />
  <span class="b-txt">$form</span><span class="g-txt">[</span><span class="r-txt">'menu_name'</span><span class="g-txt">]</span> = <span class="g-txt">array(</span><br />
  &nbsp;&nbsp;<span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'machine_name'</span><span class="g-txt">,</span><br />
  &nbsp;&nbsp;<span class="r-txt">'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Menu name'</span><span class="g-txt">),</span><br />
  &nbsp;&nbsp;<span class="r-txt">'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$menu</span><span class="g-txt">[</span><span class="r-txt">'menu_name'</span><span class="g-txt">],</span><br />
  &nbsp;&nbsp;<span class="r-txt">'#maxlength'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">MENU_MAX_MENU_NAME_LENGTH_UI</span><span class="g-txt">,</span><br />
  &nbsp;&nbsp;<span class="r-txt">'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'A unique name to construct the URL for the menu. It must only contain lowercase letters, numbers and hyphens.'</span><span class="g-txt">),</span><br />
  &nbsp;&nbsp;<span class="r-txt">'#machine_name'</span> <span class="g-txt">=&gt;</span> <span class="g-txt">array(</span><br />
  &nbsp;&nbsp;&nbsp;&nbsp;<span class="r-txt">'exists'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'menu_edit_menu_name_exists'</span><span class="g-txt">,</span><br />
  &nbsp;&nbsp;&nbsp;&nbsp;<span class="r-txt">'source'</span> <span class="g-txt">=&gt;</span> <span class="g-txt">array(</span><span class="r-txt">'title'</span><span class="g-txt">),</span><br />
  &nbsp;&nbsp;&nbsp;&nbsp;<span class="r-txt">'label'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'URL path'</span><span class="g-txt">),</span><br />
  &nbsp;&nbsp;&nbsp;&nbsp;<span class="r-txt">'replace_pattern'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'[^a-z0-9-]+'</span><span class="g-txt">,</span><br />
  &nbsp;&nbsp;&nbsp;&nbsp;<span class="r-txt">'replace'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'-'</span><span class="g-txt">,</span><br />
  &nbsp;&nbsp;<span class="g-txt">),</span><br />
  &nbsp;&nbsp;// A menu's machine name cannot be changed.<br />
  &nbsp;&nbsp;<span class="r-txt">'#disabled'</span> =&gt; !<span class="b-txt">empty</span>(<span class="b-txt">$menu</span>[<span class="r-txt">'old_name'</span>]) || <span class="b-txt">isset</span>(<span class="b-txt">$system_menus</span>[<span class="b-txt">$menu</span>[<span class="r-txt">'menu_name'</span>]])<span class="g-txt">,</span><br />
  <span class="g-txt">);</span><br />
  ?&gt;<br />
</span></code>
</div>

<!-- End machine_name_element -->


<h3><a name="managed_file" id="managed_file">managed_file</a></h3>

<p><strong>Description</strong>: Provides a complete ajax/progress aware widget for uploading a file and saving it to the {file_managed} table.</p>

<p>By default a simple upload button is provided for choosing the file to upload. Once a file has been chosen it can be explicitly uploaded via the "Upload" button. The upload is via AJAX and a progress meter is displayed. The form's validate and submit handlers receive a file object ID in $form_state['values'] that represents the ID of the new file in the {file_managed} table.</p>

<p>The #managed_file element is expanded into a set of FAPI elements including two '#submit' buttons one for Upload one for Remove, a '#file' element and a handful of '#hidden' and '#markup' elements to handle progress indication and displaying of already uploaded files.</p>

<p><strong>Note:</strong> New files are uploaded with a status of 0 and are treated as temporary files which are removed after 6 hours via cron. Your module is responsible for changing the $file objects status to FILE_STATUS_PERMANENT and saving the new status to the database. Something like the following within your submit handler should do the trick.</p>
<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />  </span><span style="color: #FF8000">// Load the file via file.fid.<br />  </span><span style="color: #0000BB">$file </span><span style="color: #007700">= </span><span style="color: #0000BB">file_load</span><span style="color: #007700">(</span><span style="color: #0000BB">$form_state</span><span style="color: #007700">[</span><span style="color: #DD0000">'values'</span><span style="color: #007700">][</span><span style="color: #DD0000">'my_file_field'</span><span style="color: #007700">]);<br />  </span><span style="color: #FF8000">// Change status to permanent.<br />  </span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">status </span><span style="color: #007700">= </span><span style="color: #0000BB">FILE_STATUS_PERMANENT</span><span style="color: #007700">;<br />  </span><span style="color: #FF8000">// Save.<br />  </span><span style="color: #0000BB">file_save</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">);<br />  </span><span style="color: #FF8000">// Record that the module (in this example, user module) is using the file. <br />  </span><span style="color: #0000BB">file_usage_add</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">, </span><span style="color: #DD0000">'user'</span><span style="color: #007700">, </span><span style="color: #DD0000">'user'</span><span style="color: #007700">, </span><span style="color: #0000BB">$account</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">uid</span><span style="color: #007700">);  <br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
<p>(Without the call to file_usage_add, file_managed_file_validate produces an error upon saving the form, saying that the uploaded file may not be referenced.)</p>
<p>Once a file has been uploaded the file object's fid can be used as the #default_value for the form element. This will display an icon, a link to the file, and a remove button.</p>

<p>Clicking the remove button sets the value of the field to 0 and your module is responsible for actually removing the file from the files table and the file system using file_delete().</p>

<p><strong>Non-standard form element properties</strong>:</p>
<ul>
<li>#progress_indicator: options are 'none', 'bar', and 'throbber', default is 'throbber'.</li>
<li>#progress_message: (string) Progress message to display along with progress meter while a file is being uploaded. Defaults to NULL.</li>
<li>#upload_validators: (array) an array of callback functions to perform validation of uploaded files.</li>
<li>#upload_location (string) location on server where uploaded files should be stored. e.g.) 'public://files/my_files_director'</li>
</ul>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, 
<a href="#array_parents">#array_parents</a>, <a href="#attached">#attached</a>, 
<a href="#attributes">#attributes</a>, <a href="#description">#description</a>, 
<a href="#disabled">#disabled</a>, <a href="#element_validate">#element_validate</a>, 
<a href="#parents">#parents</a>, <a href="#post_render">#post_render</a>, 
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>,
<a href="#process">#process</a>, <a href="#states">#states</a>, 
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, 
<a href="#theme_wrappers">#theme_wrappers</a>, <a href="#title">#title</a>, 
<a href="#tree">#tree</a>, <a href="#weight">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/drupal/developer--examples--image_example--image_example.pages.inc">image_example.pages.inc</a>.):</p>

<div class="codeblock"><code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 187);">&lt;?php<br /></span><span style="color: rgb(255, 128, 0);">// Use the #managed_file FAPI element to upload an image file.<br /></span><span style="color: rgb(0, 0, 187);">$form</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'image_example_image_fid'</span><span style="color: rgb(0, 119, 0);">] = array(<br />&nbsp; </span><span style="color: rgb(221, 0, 0);">'#title' </span><span style="color: rgb(0, 119, 0);">=&gt; </span><span style="color: rgb(0, 0, 187);">t</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'Image'</span><span style="color: rgb(0, 119, 0);">),<br />&nbsp; </span><span style="color: rgb(221, 0, 0);">'#type' </span><span style="color: rgb(0, 119, 0);">=&gt; </span><span style="color: rgb(221, 0, 0);">'managed_file'</span><span style="color: rgb(0, 119, 0);">,<br />&nbsp; </span><span style="color: rgb(221, 0, 0);">'#description' </span><span style="color: rgb(0, 119, 0);">=&gt; </span><span style="color: rgb(0, 0, 187);">t</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'The uploaded image will be displayed on this page using the image style choosen below.'</span><span style="color: rgb(0, 119, 0);">),<br />&nbsp; </span><span style="color: rgb(221, 0, 0);">'#default_value' </span><span style="color: rgb(0, 119, 0);">=&gt; </span><span style="color: rgb(0, 0, 187);">variable_get</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'image_example_image_fid'</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(221, 0, 0);">''</span><span style="color: rgb(0, 119, 0);">),<br />&nbsp; </span><span style="color: rgb(221, 0, 0);">'#upload_location' </span><span style="color: rgb(0, 119, 0);">=&gt; </span><span style="color: rgb(221, 0, 0);">'public://image_example_images/'</span><span style="color: rgb(0, 119, 0);">,<br />);<br /></span><span style="color: rgb(0, 0, 187);">?&gt;</span></span></code></div>

<!-- End managed_file -->

<h3><a name="markup" id="markup">markup</a></h3>

<p><strong>Description</strong>: Generate
generic markup for display
inside forms. Note that there is <strong>no need to declare a form
element as #type = 'markup'</strong>, as this is the default type.</p>

<p>Note:
if you use markup, if your content is not wrapped in tags (generally
&lt;p&gt; or &lt;div&gt;), your content will fall outside of collapsed
fieldsets.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#element_validate">#element_validate</a>,
<a href="#markup-attribute">#markup</a>, <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>, <a href="#tree">#tree</a>,
<a href="#type">#type</a>, <a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/contact/contact.module">contact.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'contact_information'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp;&nbsp;'#markup'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">variable_get</span><span class="g-txt">(</span><span class="r-txt">'contact_form_information'</span><span class="g-txt">,</span>
<span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'You can leave us a message using the contact form
below.'</span><span class="g-txt">)),<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="password" id="password">password</a></h3>

<p><strong>Description</strong>:
Format a single-line text field that
does not display its contents visibly.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#description">#description</a>,
<a href="#disabled">#disabled</a>, <a href="#element_validate">#element_validate</a>, <a href="#field_prefix">#field_prefix</a>, <a href="#field_suffix">#field_suffix</a>,
<a href="#maxlength"><strong>#maxlength</strong></a> (default: 128), <a href="#parents">#parents</a>, <a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="#required">#required</a>, <a href="#size"><strong>#size</strong></a> (default: 60), <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/user/user.module">user.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'pass'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp; '#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'password'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Password'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#maxlength'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">64</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#size'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">15</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="password_confirm" id="password_confirm">password_confirm</a></h3>

<p><strong>Description</strong>:
Format a pair of <a href="#password">password</a>
fields, which do not validate unless the two entered passwords match.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#description">#description</a>,
<a href="#disabled">#disabled</a>, <a href="#element_validate">#element_validate</a>,
<a href="#field_prefix">#field_prefix</a>, <a href="#field_suffix">#field_suffix</a>,
<a href="#parents">#parents</a>, <a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="#required">#required</a>, <a href="#size"><strong>#size</strong></a> (default: 60), <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/user/user.module">user.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'pass'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp; '#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'password_confirm'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Password'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#size'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">25</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="radio" id="radio">radio</a></h3>

<p><strong>Description</strong>: Format a
radio button.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>,
<a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>,
<a href="#field_prefix">#field_prefix</a>, <a href="#field_suffix">#field_suffix</a>,
<a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#required">#required</a>, <a href="#return_value">#return_value</a>,
<a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a> (default: after),
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong>:</p>

<p>N/A</p>

<h3><a name="radios" id="radios">radios</a></h3>

<p><strong>Description</strong>: Format a
set of radio buttons.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>,
<a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>, <a href="#options"><strong>#options</strong></a>,
<a href="#parents">#parents</a>, <a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="#required">#required</a>, <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/drupal/modules--poll--poll.module">poll.module</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /> &nbsp;&nbsp;$active </span><span style="color: #007700">= array(</span><span style="color: #0000BB">0 </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Closed'</span><span style="color: #007700">), </span><span style="color: #0000BB">1 </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Active'</span><span style="color: #007700">));<br />...<br /> &nbsp;&nbsp;</span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'settings'</span><span style="color: #007700">][</span><span style="color: #DD0000">'active'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'radios'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Poll status'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=&gt; isset(</span><span style="color: #0000BB">$node</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">active</span><span style="color: #007700">) ? </span><span style="color: #0000BB">$node</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">active </span><span style="color: #007700">: </span><span style="color: #0000BB">1</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$active</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'#description' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'When a poll is closed, visitors can no longer vote for it.'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'#access' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$admin</span><span style="color: #007700">,<br />&nbsp;&nbsp;);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="select" id="select">select</a></h3>

<p><strong>Description</strong>: Format a drop-down menu or scrolling selection box.
See <a href="#empty_option">#empty_option</a> and
<a href="#empty_value">#empty_value</a> for an explanation
of various settings for a select element, including behavior if #required is TRUE or FALSE.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>,
<a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>,
<a href="#empty_option"><strong>#empty_option</strong></a>,
<a href="#empty_value"><strong>#empty_value</strong></a>,
<a href="#field_prefix">#field_prefix</a>, <a href="#field_suffix">#field_suffix</a>,
<a href="#multiple"><strong>#multiple</strong></a>,
<a href="#options"><strong>#options</strong></a>, <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#required">#required</a>, <a href="#size">#size</a>, <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/drupal/modules--contact--contact.admin.inc">contact.admin.inc</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /> &nbsp; $form</span><span style="color: #007700">[</span><span style="color: #DD0000">'selected'</span><span style="color: #007700">] = array(<br /> &nbsp;&nbsp;&nbsp;   </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'select'</span><span style="color: #007700">,<br />  &nbsp;&nbsp;&nbsp;  </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Selected'</span><span style="color: #007700">),<br />   &nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=&gt; array(<br />   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  </span><span style="color: #0000BB">0 </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'No'</span><span style="color: #007700">),<br />  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  </span><span style="color: #0000BB">1 </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Yes'</span><span style="color: #007700">),<br />   &nbsp;&nbsp;&nbsp; ),<br />   &nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$category</span><span style="color: #007700">[</span><span style="color: #DD0000">'selected'</span><span style="color: #007700">],<br />  &nbsp;&nbsp;&nbsp;  </span><span style="color: #DD0000">'#description' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Set this to &lt;em&gt;Yes&lt;/em&gt; if you would like this category to be selected by default.'</span><span style="color: #007700">),<br />&nbsp;  );<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="submit" id="submit">submit</a></h3>

<p><strong>Description</strong>: Format a form submit button.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#button_type">#button_type</a>
(default: 'submit'), <a href="#disabled">#disabled</a>, <a href="#element_validate">#element_validate</a>, <a href="#executes_submit_callback">#executes_submit_callback</a>
(default: TRUE), <a href="#limit_validation_errors">#limit_validation_errors</a>,
<a href="#name">#name</a> (default: 'op'), <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="#submit_property">#submit</a>,
<a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>, <a href="#tree">#tree</a>,
<a href="#type"><strong>#type</strong></a>, <a href="#validate">#validate</a>,
<a href="#value"><strong>#value</strong></a>, <a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/locale/locale.module">locale.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'submit'</span><span class="g-txt">] = array(</span><span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'submit'</span><span class="g-txt">,</span> <span class="r-txt">'#value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Import'</span><span class="g-txt">));<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="tableselect" id="tableselect">tableselect</a></h3>

<p><strong>Description</strong>:
A table created with a far left column of radios or checkboxes. Build the table headings and
columns with the #headers property, and the rows with the #options property. See
<a href="http://drupal.org/node/945102#drupal7">Adding checkboxes to a table</a>
for a full explanation.</p>
<p>Other settings:</p>
<ul>
<li>
To set accessibility tags for the radios or checkboxes, build one of the cells in the #options property
using the 'title' => array( 'data' => array(#title => 'mytitle'))) construction, as in the $options variable
in the usage example below. Drupal will create invisible label tags for the left column based on this value.</li>
<li>To disable the default "check all" button for the checkboxes, set
#js_select property to FALSE. This is FALSE by default for radios. </li>
<li>Setting #multiple to TRUE will give you checkboxes instead of radios. </li>
</ul>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>,
<a href="#element_validate">#element_validate</a>, <a href="#empty">#empty</a>,
<a href="#header_prop">#header</a>, <a href="#js_select">#js_select</a>, <a href="#multiple"><strong>#multiple</strong></a>, <a href="#options"><strong>#options</strong></a>,
<a href="#parents">#parents</a>, <a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>,
<a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/drupal/modules--node--node.admin.inc/">node.admin.inc</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp; </span><span style="color: #FF8000">// Build the sortable table header.<br />&nbsp; </span><span style="color: #0000BB">$header </span><span style="color: #007700">= array(<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'title' </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">'data' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Title'</span><span style="color: #007700">), </span><span style="color: #DD0000">'field' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'n.title'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'type' </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">'data' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Type'</span><span style="color: #007700">), </span><span style="color: #DD0000">'field' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'n.type'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'author' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Author'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'status' </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">'data' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Status'</span><span style="color: #007700">), </span><span style="color: #DD0000">'field' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'n.status'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'changed' </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">'data' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Updated'</span><span style="color: #007700">), </span><span style="color: #DD0000">'field' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'n.changed'</span><span style="color: #007700">, </span><span style="color: #DD0000">'sort' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'desc'</span><span style="color: #007700">)<br />&nbsp; );<br />...<br />&nbsp; </span><span style="color: #FF8000">//Get the node data.<br />&nbsp; </span><span style="color: #0000BB">$nids </span><span style="color: #007700">= </span><span style="color: #0000BB">$query<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fields</span><span style="color: #007700">(</span><span style="color: #DD0000">'n'</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'nid'</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp; -&gt;</span><span style="color: #0000BB">limit</span><span style="color: #007700">(</span><span style="color: #0000BB">50</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp; -&gt;</span><span style="color: #0000BB">orderByHeader</span><span style="color: #007700">(</span><span style="color: #0000BB">$header</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp; -&gt;</span><span style="color: #0000BB">execute</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp; -&gt;</span><span style="color: #0000BB">fetchCol</span><span style="color: #007700">();<br />&nbsp; </span><span style="color: #0000BB">$nodes </span><span style="color: #007700">= </span><span style="color: #0000BB">node_load_multiple</span><span style="color: #007700">(</span><span style="color: #0000BB">$nids</span><span style="color: #007700">);<br />...<br />&nbsp; </span><span style="color: #FF8000">//Build the rows.<br />&nbsp; </span><span style="color: #0000BB">$options </span><span style="color: #007700">= array();<br />&nbsp; foreach (</span><span style="color: #0000BB">$nodes </span><span style="color: #007700">as </span><span style="color: #0000BB">$node</span><span style="color: #007700">) {<br />...<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #0000BB">$node</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">nid</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'title' </span><span style="color: #007700">=&gt; array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'data' </span><span style="color: #007700">=&gt; array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'link'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$node</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">title</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#href' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'node/' </span><span style="color: #007700">. </span><span style="color: #0000BB">$node</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">nid</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$l_options</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#suffix' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">' ' </span><span style="color: #007700">. </span><span style="color: #0000BB">theme</span><span style="color: #007700">(</span><span style="color: #DD0000">'mark'</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'type' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">node_mark</span><span style="color: #007700">(</span><span style="color: #0000BB">$node</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">nid</span><span style="color: #007700">, </span><span style="color: #0000BB">$node</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">changed</span><span style="color: #007700">))),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'type' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">check_plain</span><span style="color: #007700">(</span><span style="color: #0000BB">node_type_get_name</span><span style="color: #007700">(</span><span style="color: #0000BB">$node</span><span style="color: #007700">)),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'author' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">theme</span><span style="color: #007700">(</span><span style="color: #DD0000">'username'</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'account' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$node</span><span style="color: #007700">)),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'status' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$node</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">status </span><span style="color: #007700">? </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'published'</span><span style="color: #007700">) : </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'not published'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'changed' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">format_date</span><span style="color: #007700">(</span><span style="color: #0000BB">$node</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">changed</span><span style="color: #007700">, </span><span style="color: #DD0000">'short'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; );<br />&nbsp;&nbsp; </span><span style="color: #FF8000">//For simplicity, this example omits the code to set the operations column.<br /></span><span style="color: #007700">...<br />&nbsp; </span><span style="color: #FF8000">//Build the tableselect.<br />&nbsp; </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'nodes'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'tableselect'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#header' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$header</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$options</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#empty' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'No content available.'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; );<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="text_format" id="text_format">text_format</a></h3>

<p><strong>Description</strong>:
A text-format-enabled version of a textarea.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#cols"><strong>#cols</strong></a>
(default: 60), <a href="#default_value"><strong>#default_value</strong></a>,
<a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>, <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#required">#required</a>, <a href="#resizable">#resizable</a>
(default: TRUE), <a href="#rows"><strong>#rows</strong></a> (default:
5), <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>,<a href="#type"><strong>#type</strong></a>, <a href="#weightval">#weight</a></p>

<p><strong>Non-standard Properties</strong>:</p>
<ul>
<li>#format: the format to apply. If you want to use the default format, set this property to NULL in your form constructor function, and the filter system will handle the rest.</li>
<li>#base_type (optional): defaults to 'textarea'. This makes it possible to also attach the text format selector to other form element types, such as textfields.</li>
</ul>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/taxonomy/taxonomy.admin.inc">taxonomy.admin.inc</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp; $form</span><span style="color: #007700">[</span><span style="color: #DD0000">'description'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'text_format'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Description'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$term</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">description</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#format' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$term</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">format</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#weight' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />&nbsp; );<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="textarea" id="textarea">textarea</a></h3>

<p><strong>Description</strong>:
Format a multiple-line text field.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#cols"><strong>#cols</strong></a>
(default: 60), <a href="#default_value"><strong>#default_value</strong></a>,
<a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>,
<a href="#field_prefix">#field_prefix</a>, <a href="#field_suffix">#field_suffix</a>,
<a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#required">#required</a>, <a href="#resizable">#resizable</a>
(default: TRUE), <a href="#rows"><strong>#rows</strong></a> (default:
5), <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>, <a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/comment/comment.module">comment.module</a>):</p>

<div class="codeblock">
<code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />
$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'keywords'</span><span style="color: #007700">] = array(<br /></span><span style="color: #DD0000">'#title' </span>
<span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Keywords'</span><span style="color: #007700">),<br /></span>
<span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'textarea'</span><span style="color: #007700">,<br /></span>
<span style="color: #DD0000">'#description' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span>
<span style="color: #007700">(</span><span style="color: #DD0000">'The comment will be unpublished if it contains any of the phrases above. Use a case-sensitive, comma-separated list of phrases. Example: funny, bungee jumping, "Company, Inc."'</span><span style="color: #007700">),<br /></span>
<span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=&gt; isset(</span>  <span style="color: #0000BB">$context</span><span style="color: #007700">[</span><span style="color: #DD0000">'keywords'</span><span style="color: #007700">]) ? </span><span style="color: #0000BB">drupal_implode_tags</span><span style="color: #007700">(</span><span style="color: #0000BB">$context</span><span style="color: #007700">[</span><span style="color: #DD0000">'keywords'</span><span style="color: #007700">]) : </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />);<br /></span>
<span style="color: #0000BB">?&gt;</span></span></code>
</div>


<h3><a name="textfield" id="textfield">textfield</a></h3>

<p><strong>Description</strong>:
Format a single-line text field.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#autocomplete_path">#autocomplete_path</a>
(default: FALSE), <a href="#default_value"><strong>#default_value</strong></a>,
<a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>, <a href="#field_prefix">#field_prefix</a>, <a href="#field_suffix">#field_suffix</a>,
<a href="#maxlength"><strong>#maxlength</strong></a> (default: 128), <a href="#parents">#parents</a>, <a href="#post_render">#post_render</a>,
<a href="#prefix">#prefix</a>, <a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>, <a href="#required">#required</a>, <a href="#size"><strong>#size</strong></a> (default: 60), <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#text_format">#text_format</a>,
<a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>, <a href="#type"><strong>#type</strong></a>, <a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/forum/forum.module">forum.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'title'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'textfield'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Subject'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">title</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#size'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#maxlength'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">128</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#required'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="token" id="token">token</a></h3>

<p><strong>Description</strong>:
Store token data in a hidden form field (generally used to protect
against cross-site forgeries). A token element is automatically added
to each Drupal form by drupal_prepare_form(), so you don't generally
have to add one yourself.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#default_value">#default_value</a>,
<a href="#element_validate">#element_validate</a>, <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>, <a href="#tree">#tree</a>,
<a href="#type"><strong>#type</strong></a>, <a href="#value"><strong>#value</strong></a>,
<a href="#weightval">#weight</a></p>

<h3><a name="val" id="val">value</a></h3>

<p><strong>Description</strong>: A form value
that is internal to the
form and never displayed to the screen.</p>

<p><strong>Properties</strong>: <a href="#type"><strong>#type</strong></a>,
<a href="#value"><strong>#value</strong></a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/node/node.module">node.module</a>):</p>

<p><code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'vid'</span><span class="g-txt">] =</span> <span class="b-txt">array</span><span class="g-txt">(</span><span class="r-txt">'#type'</span> =&gt; <span class="r-txt">'value'</span><span class="g-txt">,</span> <span class="r-txt">'#value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$node-&gt;vid</span><span class="g-txt">);<br />
</span><span class="b-txt">?&gt;</span></span></code></p>

<p>Note that as of Drupal 6, you can also simply store arbitrary
variables in <code>$form['#foo']</code> instead, as long as <code>'#foo'</code>
does not conflict with any other internal property of the Form API.</p>

<h3><a name="vertical_tabs" id="vertical_tabs">vertical_tabs</a></h3>

<p><strong>Description</strong>:
Formats all child fieldsets and all non-child fieldsets whose <a href="#group">#group</a> is assigned this element's name as vertical
 tabs.</p>

<p><strong>Properties</strong>:
<a href="#access">#access</a>, <a href="#after_build">#after_build</a>,
<a href="#default_tab"><strong>#default_tab</strong></a>,
<a href="#element_validate">#element_validate</a>, <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>, <a href="#tree">#tree</a>,
<a href="#type"><strong>#type</strong></a>, <a href="#weightval">#weight</a></p>

<p><strong>Functions that use vertical_tabs</strong>:<br />
<a href="http://api.drupal.org/api/drupal/modules%21block%21block.admin.inc/function/block_admin_configure">block_admin_configure</a> in
<a href="http://api.drupal.org/api/drupal/modules%21block%21block.admin.inc">block.admin.inc</a><br />
<a href="http://api.drupal.org/api/drupal/modules%21user%21user.admin.inc/function/user_admin_settings">user_admin_settings</a> in
<a href="http://api.drupal.org/api/drupal/modules%21user%21user.admin.inc">user.admin.inc</a>
</p>

<h3><a name="weight" id="weight">weight</a></h3>

<p><strong>Description</strong>: Format a
weight selection menu.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#attributes">#attributes</a>,
<a href="#default_value"><strong>#default_value</strong></a>, <a href="#delta"><strong>#delta</strong></a> (default: 10), <a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>, <a href="#parents">#parents</a>,
<a href="#post_render">#post_render</a>, <a href="#prefix">#prefix</a>,
<a href="#pre_render">#pre_render</a>, <a href="#process">#process</a>,
<a href="#required">#required</a>, <a href="#states">#states</a>,
<a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#theme_wrappers">#theme_wrappers</a>,
<a href="#title"><strong>#title</strong></a>, <a href="#title_display">#title_display</a>,
<a href="#tree">#tree</a>,
<a href="#type"><strong>#type</strong></a>, <a href="#weightval">#weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/menu/menu.module">menu.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'weight'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'weight'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Weight'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$edit</span><span class="g-txt">[</span><span class="r-txt">'weight'</span><span class="g-txt">],</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#delta'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">10</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Optional.
In the menu, the heavier items will sink and the lighter items will be
positioned nearer the top.'</span><span class="g-txt">),<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h2><a name="properties" id="properties">Properties</a></h2>

<h3><a name="access" id="access">#access</a></h3>

<p><strong>Used by</strong>: All elements
and forms</p>

<p><strong>Description</strong>:
Whether the element is accessible or not; when FALSE, the element is
not rendered and the user submitted value is not taken into
consideration.</p>

<p><strong>Values</strong>: TRUE or FALSE.</p>

<h3><a name="action" id="action">#action</a></h3>

<p><strong>Used by</strong>: <a href="#form">form</a></p>

<p><strong>Description</strong>: The path to which the form will be
submitted.</p>

<p><strong>Values</strong>: An internal path</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/comment/comment.module">comment.module</a>):</p>

<div class="codeblock">
<p><code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'#action'</span><span class="g-txt">] =</span> <span class="b-txt">url</span><span class="g-txt">(</span><span class="r-txt">'comment/reply/'</span><span class="g-txt">.</span> <span class="b-txt">$edit</span><span class="g-txt">[</span><span class="r-txt">'nid'</span><span class="g-txt">]);<br />
</span> <span class="b-txt">?&gt;</span></span></code></p>
</div>

<h3><a name="after_build" id="after_build">#after_build</a></h3>

<p><strong>Used by</strong>: All
elements and forms</p>

<p><strong>Description</strong>:
An array of function names which will
be called after the form or element is built.</p>

<p><strong>Usage example</strong>
(<a href="http://api.drupal.org/api/file/modules/system/system.admin.inc">system.admin.inc</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp; $form</span><span style="color: #007700">[</span><span style="color: #DD0000">'file_public_path'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'textfield'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Public file system path'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">variable_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'file_public_path'</span><span style="color: #007700">, </span><span style="color: #0000BB">conf_path</span><span style="color: #007700">() . </span><span style="color: #DD0000">'/files'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#maxlength' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">255</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#description' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'A local file system path where public files will be stored. This directory must exist and be writable by Drupal. This directory must be relative to the Drupal installation directory and be accessible over the web.'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#after_build' </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">'system_check_directory'</span><span style="color: #007700">),<br />&nbsp; );<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="ajax" id="ajax" href="http://api.drupal.org/api/drupal/includes--ajax.inc/group/ajax">#ajax</a></h3>

<p><strong>Used by</strong>: <a href="#button">button</a>, <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#image_button">image button</a>, <a href="#password">password</a>,
<a href="#radio">radio</a>, <a href="#radios">radios</a>, <a href="#select">select</a>, <a href="#submit">submit</a>, <a href="#tableselect">tableselect</a>, <a href="#textarea">textarea</a>, <a href="#text_format">text_format</a>,
<a href="#textfield">textfield</a> </p>

<p>An array of elements whose values control the behavior of the
element with respect to the <a href="http://api.drupal.org/api/drupal/includes--ajax.inc/group/ajax">Drupal AJAX framework</a>.</p>

<p><a href="http://en.wikipedia.org/wiki/AJAX">AJAX</a>
(Asynchronous Javascript and XML) is a term used for dynamic
communication between the browser and the server, without page reloads.
A purist would insist that the Drupal technique is <a href="http://en.wikipedia.org/wiki/AHAH">AHAH</a>
(Asychronous HTML and HTTP) because XML is not used. Until Drupal 7,
AJAX was known as AHAH. In a nutshell an AJAX request follows these
steps:</p>

<ol>

  <li>Drupal builds a form element with a set of #ajax properties. The <code>misc/ajax.js</code>
file is included on the page automatically. </li>
  <li>ajax.js finds all the form elements on the page that have an <a href="#ajax_callback">#ajax['callback']</a> <em>or</em> an <a href="#ajax_path">#ajax['path']</a> set and adds an event handler for
the <a href="#ajax_event">#ajax['event']</a> set on that form element.</li>
  <li>When the <a href="#ajax_event">#ajax['event']</a> occurs on the
element (such as 'click'), the AJAX request is made to the Drupal path
of the element's <a href="#ajax_path">#ajax['path']</a>. If an <a href="#ajax_callback">#ajax['callback']</a> has been specified (the
normal case), the Drupal path will be <code>system/ajax</code>.</li>
  <li>Form information gets processed, and the function specified in <a href="#ajax_callback">#ajax['callback']</a> is called. &nbsp;<a href="forms_api_reference.html#ajax_callback">#ajax['callback']</a>
can return either HTML, a renderable array, or an array of <a href="http://api.drupal.org/api/group/ajax_commands">AJAX commands</a>.</li>
  <li>While the user
waits for the callback to execute a throbber or progress bar is shown
as determined by <a href="#ajax_progress">#ajax['progress']</a>. The
result is returned to the original page containing the form element.</li>
  <li>ajax.js gets the result. If it is HTML and&nbsp;<a href="forms_api_reference.html#ajax_wrapper">#ajax['wrapper']</a> is
set, the HTML replaces the element specified by <a href="forms_api_reference.html#ajax_wrapper">#ajax['wrapper']</a>. If
it is an array of AJAX commands, the commands are executed. and inserts
the returned HTML into the <a href="#ajax_wrapper">#ajax['wrapper']</a>.&nbsp;</li>
</ol>

<p>Example usages of basic AJAX and AJAX commands are provided in the <a href="http://drupal.org/project/examples">Examples module</a>.</p>

<h3><a name="ajax_callback" id="ajax_callback">#ajax['callback']</a></h3>

<p><strong>Description</strong>:
Specifies the name of a callback function which will be called during
an AJAX call. It can return HTML, a renderable array, or an array of <a href="http://api.drupal.org/api/group/ajax_commands">AJAX Commands</a>.
This callback
function is given the <code>$form</code> and <code>$form_state</code>
parameters, allowing it to produce a result, which it returns for
rendering.</p>

<p>Note:
#ajax['callback'] and #ajax['path'] are mutually exclusive. 'callback'
is easier to
use and requires less code setup, but may not provide the
capabilities required for some functions. When you can, use 'callback'.</p>

<p><strong>Values</strong>: String containing a function name.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/poll/poll.module/">poll.module</a>):</p>

<div class="codeblock"> <code><span style="color: rgb(0, 0, 0);"> <span style="color: rgb(0, 0, 187);">&lt;?php<br />
</span><span style="color: rgb(255, 128, 0);">/**<br />
&nbsp;*&nbsp;Implementation&nbsp;of&nbsp;hook_form().<br />
&nbsp;*/<br />
</span><span style="color: rgb(0, 119, 0);">function&nbsp;</span><span style="color: rgb(0, 0, 187);">poll_form</span><span style="color: rgb(0, 119, 0);">(&amp;</span><span style="color: rgb(0, 0, 187);">$node</span><span style="color: rgb(0, 119, 0);">,&nbsp;</span><span style="color: rgb(0, 0, 187);">$form_state</span><span style="color: rgb(0, 119, 0);">)&nbsp;{<br />
&nbsp;&nbsp;...<br />
&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 187);">$form</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'choice_wrapper'</span><span style="color: rgb(0, 119, 0);">][</span><span style="color: rgb(221, 0, 0);">'poll_more'</span><span style="color: rgb(0, 119, 0);">]&nbsp;=&nbsp;array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(221, 0, 0);">'#type'&nbsp;</span><span style="color: rgb(0, 119, 0);">=&gt;&nbsp;</span><span style="color: rgb(221, 0, 0);">'submit'</span><span style="color: rgb(0, 119, 0);">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(221, 0, 0);">'#value'&nbsp;</span><span style="color: rgb(0, 119, 0);">=&gt;&nbsp;</span><span style="color: rgb(0, 0, 187);">t</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'More&nbsp;choices'</span><span style="color: rgb(0, 119, 0);">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(221, 0, 0);">'#description'&nbsp;</span><span style="color: rgb(0, 119, 0);">=&gt;&nbsp;</span><span style="color: rgb(0, 0, 187);">t</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">"If&nbsp;the&nbsp;amount&nbsp;of&nbsp;boxes&nbsp;above&nbsp;isn't&nbsp;enough,&nbsp;click&nbsp;here&nbsp;to&nbsp;add&nbsp;more&nbsp;choices."</span><span style="color: rgb(0, 119, 0);">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(221, 0, 0);">'#weight'&nbsp;</span><span style="color: rgb(0, 119, 0);">=&gt;&nbsp;</span><span style="color: rgb(0, 0, 187);">1</span><span style="color: rgb(0, 119, 0);">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(221, 0, 0);">'#submit'&nbsp;</span><span style="color: rgb(0, 119, 0);">=&gt;&nbsp;array(</span><span style="color: rgb(221, 0, 0);">'poll_more_choices_submit'</span><span style="color: rgb(0, 119, 0);">),&nbsp;</span><span style="color: rgb(255, 128, 0);">//&nbsp;If&nbsp;no&nbsp;javascript&nbsp;action.<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(221, 0, 0);">'#ajax'&nbsp;</span><span style="color: rgb(0, 119, 0);">=&gt;&nbsp;array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(221, 0, 0);">'callback'&nbsp;</span><span style="color: rgb(0, 119, 0);">=&gt;&nbsp;</span><span style="color: rgb(221, 0, 0);">'poll_choice_js'</span><span style="color: rgb(0, 119, 0);">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(221, 0, 0);">'wrapper'&nbsp;</span><span style="color: rgb(0, 119, 0);">=&gt;&nbsp;</span><span style="color: rgb(221, 0, 0);">'poll-choices'</span><span style="color: rgb(0, 119, 0);">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(221, 0, 0);">'method'&nbsp;</span><span style="color: rgb(0, 119, 0);">=&gt;&nbsp;</span><span style="color: rgb(221, 0, 0);">'replace'</span><span style="color: rgb(0, 119, 0);">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(221, 0, 0);">'effect'&nbsp;</span><span style="color: rgb(0, 119, 0);">=&gt;&nbsp;</span><span style="color: rgb(221, 0, 0);">'fade'</span><span style="color: rgb(0, 119, 0);">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;),<br />
&nbsp;&nbsp;);<br />
&nbsp;&nbsp;...<br />
}<br />
<br />
</span><span style="color: rgb(255, 128, 0);">/**<br />
&nbsp;*&nbsp;Menu&nbsp;callback&nbsp;for&nbsp;AJAX&nbsp;additions.&nbsp;Render&nbsp;the&nbsp;new&nbsp;poll&nbsp;choices.<br />
&nbsp;*/<br />
</span><span style="color: rgb(0, 119, 0);">function
poll_choice_js($form, $form_state) {<br />
&nbsp; return $form['choice_wrapper']['choice'];<br />
}<br />
</span><span style="color: rgb(0, 119, 0);">?&gt;</span> </span> </code>
</div>

<h3><a name="ajax_effect" id="ajax_effect">#ajax['effect']</a></h3>

<p><strong>Description</strong>:
Specifies the effect used when adding
the content from an AJAX request.</p>

<p><strong>Values</strong>:
String. Possible values: 'none' (default),
'fade', 'slide'. If the <a href="http://interface.eyecon.ro/">interface
elements library</a> is installed, any effect with the name <em>effect</em>Toggle
may also be used. </p>

<h3><a name="ajax_event" id="ajax_event">#ajax['event']</a></h3>

<p><strong>Description</strong>:
When this event occurs to this
element, Drupal will perform an HTTP request in the background via
Javascript.</p>

<p><strong>Values</strong>:
String. Possible values: Any valid <a href="http://docs.jquery.com/Events">jQuery event</a>, including 'mousedown' (for
submit, imagebutton, and button), 'blur' (for textfield and textarea), 'change' (for
select). Note that #ajax['event'] does not need to be explicitly
specified. Although it can be manually set, usually the default value
will be sufficient.</p>

<h3><a name="ajax_keypress" id="ajax_keypress">#ajax['keypress']</a></h3>
<p><strong>Description</strong>:
If set to TRUE, then the element's #ajax['event'] will be triggered if the 
ENTER key is pressed while the element has focus.</p>


<h3><a name="ajax_method" id="ajax_method">#ajax['method']</a></h3>

<p><strong>Description</strong>:
Modify the behavior of the returned
HTML from an AJAX request when inserting into the <a href="#ajax_wrapper">#ajax['wrapper']</a>. If not set, the returned
HTML will <span style="font-style: italic;">replace</span> the
contents of the wrapper element, but it's also possible to use any of
the available <a href="http://docs.jquery.com/DOM/Manipulation">jQuery
operations for DOM manipulation</a>. </p>

<p><strong>Values</strong>: String. Possible values: 'replace'
(default), 'after', 'append', 'before', 'prepend'.</p>

<h3><a name="ajax_path" id="ajax_path">#ajax['path']</a></h3>

<p><strong>Description</strong>:
This is the Drupal menu path for a callback function which will
generate
HTML and return the string of HTML to Drupal. The result will replace
the div specified in <a href="#ajax_wrapper">#ajax['wrapper']</a>.
This property is infrequently used in Drupal 7 and higher, because it
is set automatically if using the <a href="#ajax_callback">#ajax['callback']</a>
property. When using #ajax['callback'] the path is automatically set to
<code>system/ajax</code>, which provides a menu callback that can be
used for many situations.</p>

<p>Note: 'path' and 'callback' are mutually exclusive.</p>

<p><strong>Values</strong>: String containing a Drupal menu path.</p>

<h3><a name="ajax_prevent" id="ajax_prevent">#ajax['prevent']</a></h3>

<p><strong>Description</strong>:
A JavaScript event to prevent when 'event' is triggered. Defaults to 'click' for
#ajax on #type 'submit', 'button', and 'image_button'. Multiple events may be
specified separated by spaces. For example, when binding #ajax behaviors to form
buttons, pressing the ENTER key within a textfield triggers the 'click' event of
the form's first submit button. Triggering Ajax in this situation leads to
problems, like breaking autocomplete textfields. Because of that, Ajax behaviors
are bound to the 'mousedown' event on form buttons by default. However, binding
to 'mousedown' rather than 'click' means that it is possible to trigger a click
by pressing the mouse, holding the mouse button down until the Ajax request is
complete and the button is re-enabled, and then releasing the mouse button. For
this case, 'prevent' can be set to 'click', so an additional event handler is
bound to prevent such a click from triggering a non-Ajax form submission. This
also prevents a textfield's ENTER press triggering a button's non-Ajax form
submission behavior.</p>

<p><strong>Values</strong>:
String. Possible values: One or more <a href="http://docs.jquery.com/Events">jQuery events</a>, with <a href="http://api.jquery.com/bind#multiple-events">multiple events</a> separated by space characters.</p>

<h3><a name="ajax_progress" id="ajax_progress">#ajax['progress']</a></h3>

<p><strong>Description</strong>:
Choose either a throbber or progress bar that is displayed while
awaiting a response from the callback, and add an optional message.</p>

<p><strong>Values</strong>:
Array.</p>

<p>Possible keys: 'type', 'message', 'url', 'interval'</p>

<p>Possible values:</p>

<ul>

  <li><strong>#ajax['progress']['type']</strong>
String. Possible values: 'throbber' (default), 'bar'. </li>
  <li><strong>#ajax['progress']['message']</strong>
String. An optional message to the user; should be wrapped with t(). </li>
   <li><strong>#ajax['progress']['url']</strong>
String. The optional callback path to use to determine how full the
progress bar is (as defined in progress.js). Only useable when 'type' is 'bar'. </li>
  <li><strong>#ajax['progress']['interval']</strong>
String. The interval to be used in updating the progress bar (as defined
in progress.js). Ony used if 'url' is defined and 'type' is 'bar'.
    </li>
</ul>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/file/file.module">file.module</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp; $ajax_settings</span><span style="color: #007700">[</span><span style="color: #DD0000">'progress'</span><span style="color: #007700">][</span><span style="color: #DD0000">'type'</span><span style="color: #007700">] ? </span><span style="color: #0000BB">$ajax_settings</span><span style="color: #007700">[</span><span style="color: #DD0000">'progress'</span><span style="color: #007700">][</span><span style="color: #DD0000">'type'</span><span style="color: #007700">] == </span><span style="color: #DD0000">'bar' </span><span style="color: #007700">: </span><span style="color: #DD0000">'throbber'</span><span style="color: #007700">;<br />&nbsp; </span><span style="color: #0000BB">$ajax_settings</span><span style="color: #007700">[</span><span style="color: #DD0000">'progress'</span><span style="color: #007700">][</span><span style="color: #DD0000">'message'</span><span style="color: #007700">] = </span><span style="color: #0000BB">NULL</span><span style="color: #007700">;<br />&nbsp; </span><span style="color: #0000BB">$ajax_settings</span><span style="color: #007700">[</span><span style="color: #DD0000">'effect'</span><span style="color: #007700">] = </span><span style="color: #DD0000">'none'</span><span style="color: #007700">;<br />&nbsp; </span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'remove_button'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#name' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">implode</span><span style="color: #007700">(</span><span style="color: #DD0000">'_'</span><span style="color: #007700">, </span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'#parents'</span><span style="color: #007700">]) . </span><span style="color: #DD0000">'_remove_button'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'submit'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#value' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Remove'</span><span style="color: #007700">),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#validate' </span><span style="color: #007700">=&gt; array(),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#submit' </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">'file_managed_file_submit'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#limit_validation_errors' </span><span style="color: #007700">=&gt; array(</span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'#parents'</span><span style="color: #007700">]),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#ajax' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$ajax_settings</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#weight' </span><span style="color: #007700">=&gt; -</span><span style="color: #0000BB">5</span><span style="color: #007700">,<br />&nbsp; );<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="ajax_trigger_as" id="ajax_trigger_as">#ajax['trigger_as']</a></h3>
<p><strong>Description</strong>:
For a non-submit, non-button element, allows selection of the submit element
which will be activated when the element is triggered. For example, if a
select element is ajax-enabled, and it changes, an element identified by
#ajax['trigger_as']['name'] or #ajax['trigger_as']['value'] will be used
as the triggering element, especially for button-level validation.</p>

<p><strong>Values</strong>: Array.</p>

<p>Possible values</p>
<ul>
<li>array('name' => some_submit_or_button_name)</li>
<li>array('value' => some_submit_or_button_value)</li>
</ul>

<p>Note that if #tree == TRUE, #name encodes the parents of the element in it, as when used with form_set_error(), i.e. "level1][level2][element".</p>


<h3><a name="ajax_wrapper" id="ajax_wrapper">#ajax['wrapper']</a></h3>

<p><strong>Description</strong>:
This property defines the HTML id attribute of an element on the page
which will be replaced by the html returned by the <a href="#ajax_path">#ajax['path']</a>
or <a href="#ajax_callback">#ajax['callback']</a>
function. Usually, a div element is used as the wrapper, as it provides
the most flexibility for placement of elements before, after, or inside
of its HTML tags. This property is required for using AJAX requests in
on a form element. &nbsp;Note that the entire element with this ID is
replaced, not just the contents of the element.</p>

<p><strong>Values</strong>: String containg a valid id attribute of an
HTML element on the same page. This <span style="font-style: italic;">must
not contain</span> the '#' character that a selector would have.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/upload/upload.module">upload.module</a>):</p>

<div class="codeblock"><code><span class="def-txt"><span class="b-txt">&nbsp;&nbsp;&nbsp;
$form</span><span class="g-txt">[</span><span class="r-txt">'new'</span><span class="g-txt">][</span><span class="r-txt">'attach'</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#type' </span><span class="g-txt">=&gt; </span><span class="r-txt">'submit'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#value' </span><span class="g-txt">=&gt; </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Attach'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#name' </span><span class="g-txt">=&gt; </span><span class="r-txt">'attach'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#ajax' </span><span class="g-txt">=&gt; array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'path'
</span><span class="g-txt">=&gt; </span><span class="r-txt">'upload/js'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'wrapper'
</span><span class="g-txt">=&gt; </span><span class="r-txt">'attach-wrapper'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'progress'
</span><span class="g-txt">=&gt; array(</span><span class="r-txt">'type'
</span><span class="g-txt">=&gt; </span><span class="r-txt">'bar'</span><span class="g-txt">, </span><span class="r-txt">'message' </span><span class="g-txt">=&gt; </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Please wait...'</span><span class="g-txt">)),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#submit' </span><span class="g-txt">=&gt; array(</span><span class="r-txt">'node_form_submit_build_node'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp; );<br />
</span></span></code></div>

<h3><a name="array_parents" id="array_parents">#array_parents</a></h3>

<p><strong>Used by</strong>: All form elements</p>
<p><strong>Description</strong>: (read-only, and mostly <b>internal</b>). The array of names of the
element's parents (including itself) in the form. This will always match the structure of $form.
It is different from <a href="#parents">#parents</a> in that #parents lists only the
structure used in $form_state['values'], which is flat unless #tree is set to TRUE.
Please see the <a href="http://drupal.org/node/279246#comment-2292322">complete comparison between #parents and #array_parents</a>.</p>

<h3><a name="attached" id="attached">#attached</a></h3>

<p><strong>Used by</strong>: All form elements</p>
<p><strong>Description</strong>: Allows loading of CSS, Javascript, libraries, or custom types when
the form is built. </p>

<p><strong>Values</strong>: A keyed array of type => value pairs, where the
type (most often 'css', 'js', and 'library') determines the loading technique,
and the value provides the options presented to the loader function. See the example
below and the loader functions <a href="http://api.drupal.org/api/function/drupal_add_css">drupal_add_css()</a>, <a href="http://api.drupal.org/api/function/drupal_add_js">drupal_add_js()</a>, <a href="http://api.drupal.org/api/function/drupal_add_library">drupal_add_library()</a>, etc.
</p>

<p>See <a href="http://api.drupal.org/api/function/drupal_process_attached">drupal_process_attached()</a> for additional information.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/function/ajax_example_dependent_dropdown_degrades">AJAX Example</a>):</p>

<div class="codeblock"> <code>
$form['#attached']['css'] = array(<br/>  drupal_get_path('module', 'ajax_example') . '/ajax_example.css',<br/>);<br/>
$form['#attached']['js'] = array(<br/>  drupal_get_path('module', 'ajax_example') . '/ajax_example.js',<br/>);<br/>
</code>
</div>

<p>The above javascript #attach could also be written as:</p>
<div class="codeblock"> <code>
$form['#attached']['js'] = array(<br/>&nbsp;&nbsp;drupal_get_path('module', 'ajax_example') . '/ajax_example.js' => array(<br/>&nbsp;&nbsp;'type' => 'file',<br/>&nbsp;&nbsp;),<br/>);<br/>
</code>
</div>

<p>and inline javascript can be loaded with the javascript as the key of the array,
as described in <a href="http://api.drupal.org/api/function/drupal_add_js">drupal_add_js()</a>.</p>

<p><strong>Adding settings</strong></p>
<p>You add a javascript setting by using the 'data' key (as php keys can't be arrays):</p>
<div class="codeblock"> <code>
$settings = array('id' => 'mymodule-element-1');<br />
$form['#attached']['js'][] = array(<br/>&nbsp;&nbsp;'data' => array('mymodule' => $settings),<br/>&nbsp;&nbsp;'type' => 'setting',<br/>);<br/>
</code>
</div>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/contact/contact.pages.inc">contact.pages.inc</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">if (!</span><span style="color: #0000BB">$user</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">uid</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'#attached'</span><span style="color: #007700">][</span><span style="color: #DD0000">'library'</span><span style="color: #007700">][] = array(</span><span style="color: #DD0000">'system'</span><span style="color: #007700">, </span><span style="color: #DD0000">'jquery.cookie'</span><span style="color: #007700">);<br />    </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'#attributes'</span><span style="color: #007700">][</span><span style="color: #DD0000">'class'</span><span style="color: #007700">][] = </span><span style="color: #DD0000">'user-info-from-cookie'</span><span style="color: #007700">;<br />  }<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>


<h3><a name="attributes" id="attributes">#attributes</a></h3>

<p><strong>Used by</strong>: <a href="#actions">actions</a>, <a href="#button">button</a>, <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#container">container</a>, <a href="#date">date</a>, <a href="#fieldset">fieldset</a>, <a href="#file">file</a>, <a href="#form">form</a>, <a href="#image_button">image_button</a>, <a href="#password">password</a>,
<a href="#radio">radio</a>, <a href="#radios">radios</a>, <a href="#select">select</a>, <a href="#submit">submit</a>, <a href="#tableselect">tableselect</a>, <a href="#textarea">textarea</a>, <a href="#text_format">text_format</a>,
<a href="#textfield">textfield</a>, <a href="#weight">weight</a></p>

<p><strong>Description</strong>: Additional HTML attributes, such as
'class' can be set using this mechanism.</p>

<p><strong>Values</strong>: Any HTML attribute not covered by other
properties, e.g. <strong>class</strong> (for control types), <strong>enctype</strong>
(for forms).</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/search/search.module">search.module</a>):</p>

<p><strong>Note:</strong> If you are altering an existing form via
hook_form_alter() or a similar means, be careful with this property!
You will probably want to add to the existing array rather than writing
over it, so don't follow this usage example exactly.</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'#attributes'</span><span class="g-txt">] = array(</span><span class="r-txt">'class'</span> <span class="g-txt">=&gt;</span> <span class="g-txt">array(</span><span class="r-txt">'search-form'</span><span class="g-txt">));<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="autocomplete_path" id="autocomplete_path">#autocomplete_path</a></h3>

<p><strong>Used by</strong>:
<a href="#textfield">textfield</a></p>

<p><strong>Description</strong>: The path the AJAX autocomplete script
uses as the source for autocompletion.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/node/node.module">node.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'author'</span><span class="g-txt">][</span><span class="r-txt">'name'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp; '#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'textfield'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Authored
by'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#maxlength'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#autocomplete_path'</span> <span class="g-txt">=&gt;</span>
<span class="r-txt">'user/autocomplete'</span><span class="g-txt">,</span>
<span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">name</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#weight'</span> <span class="g-txt">=&gt; -</span><span class="b-txt">1,<br />
</span><span class="g-txt">);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="built" id="built">#built</a></h3>

<p><strong>Used by</strong>: <a href="#form">form</a></p>

<p><strong>Description</strong>: Used to ascertain whether or not a
form element has been built yet.</p>

<p><strong>Values</strong>: TRUE or FALSE</p>

<p><strong>Usage example</strong>: INTERNAL. See the <a href="http://api.drupal.org/api/function/_form_builder">_form_builder</a>
function in <a href="http://api.drupal.org/api/file/includes/form.inc">form.inc</a>.</p>

<h3><a name="button_type" id="button_type">#button_type</a></h3>

<p><strong>Used by</strong>: <a href="#button">button</a>, <a href="#image_button">image_button</a>, <a href="#submit">submit</a></p>

<p><strong>Description</strong>: Adds a CSS class to the button, in the
form <em>form-[button_type_value]</em>. Note that this does NOT set
the HTML attribute <em>type</em> of the button.</p>

<p><strong>Values</strong>: String </p>

<p><strong>Usage example</strong>: (<a href="http://api.drupal.org/api/file/modules/system/system.module">system.module</a>):</p>

<div class="codeblock"> <code>
$types['submit'] = array(<br />
&nbsp;&nbsp;'#input' => TRUE,<br />
&nbsp;&nbsp;'#name' => 'op',<br />
&nbsp;&nbsp;'#button_type' => 'submit',<br />
&nbsp;&nbsp;'#executes_submit_callback' => TRUE,<br />
&nbsp;&nbsp;'#limit_validation_errors' => FALSE,<br />
&nbsp;&nbsp;'#process' => array('ajax_process_form'),<br />
&nbsp;&nbsp;'#theme_wrappers' => array('button'),<br />
);</code> </div>

<h3><a name="children" id="children">#children</a></h3>

<p><strong>Used by</strong>: All elements.</p>

<p><strong>Description</strong>: Internal. The rendered child elements of an element.
Automatically assigned by drupal_render(), unless already set.
In rare cases, you may use #children to override the output of rendered child elements,
for example in a #theme_wrappers or #post_render callback.
Normally, you should not have to use #children, use regular child elements instead.
(See <a href="#actions">actions</a> for an example.)</p>

<p><strong>Values</strong>: String representing the rendered child elements of an element.</p>

<p><strong>Usage example</strong> <a href="http://api.drupal.org/api/drupal/includes--form.inc/function/theme_container">theme_container()</a>): <br />Example in a #theme_wrappers callback.</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">theme_container</span><span style="color: #007700">(</span><span style="color: #0000BB">$variables</span><span style="color: #007700">) {<br />&nbsp; </span><span style="color: #0000BB">$element </span><span style="color: #007700">= </span><span style="color: #0000BB">$variables</span><span style="color: #007700">[</span><span style="color: #DD0000">'element'</span><span style="color: #007700">];<br /><br />&nbsp; </span><span style="color: #FF8000">// ...<br /><br />&nbsp; </span><span style="color: #007700">return </span><span style="color: #DD0000">'&lt;div' </span><span style="color: #007700">. </span><span style="color: #0000BB">drupal_attributes</span><span style="color: #007700">(</span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'#attributes'</span><span style="color: #007700">]) . </span><span style="color: #DD0000">'&gt;' </span><span style="color: #007700">. </span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'#children'</span><span style="color: #007700">] . </span><span style="color: #DD0000">'&lt;/div&gt;'</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>


<h3><a name="collapsed" id="collapsed">#collapsed</a></h3>

<p><strong>Used by</strong>: <a href="#fieldset">fieldset</a></p>

<p><strong>Description</strong>: Indicates whether or not the fieldset
is collapsed by default. See <a href="#collapsible">#collapsible</a>
property.</p>

<p><strong>Values</strong>: TRUE or FALSE</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/block/block.module">block.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'block'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp; '#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'fieldset'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Block
configuration'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#weight'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">3</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#collapsible'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#collapsed'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">FALSE</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#tree'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="collapsible" id="collapsible">#collapsible</a></h3>

<p><strong>Used by</strong>: <a href="#fieldset">fieldset</a></p>

<p><strong>Description</strong>: Indicates whether or not the fieldset
can be collapsed with JavaScript. See <a href="#collapsed">#collapsed</a>
property.</p>

<p><strong>Values</strong>: TRUE or FALSE</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/block/block.module">block.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'block'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'fieldset'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Block
configuration'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#weight'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">3</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#collapsible'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#collapsed'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">FALSE</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#tree'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="cols" id="cols">#cols</a></h3>

<p><strong>Used by</strong>: <a href="#text_format">text_format</a>, <a href="#textarea">textarea</a></p>

<p><strong>Description</strong>: How many columns wide the textarea
should be (see also <a href="#rows">#rows</a>)</p>

<p><strong>Values</strong>: A positive number</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/aggregator/aggregator.module">aggregator.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'description'</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;</span><span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'textarea'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Description'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$edit</span><span class="g-txt">[</span><span class="r-txt">'description'</span><span class="g-txt">],</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#cols'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#rows'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">5</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="default_tab" id="default_tab">#default_tab</a></h3>

<p><strong>Used by</strong>: <a href="#vertical_tabs">vertical_tabs</a></p>

<p><strong>Description</strong>: The default open tab.</p>

<p><strong>Values</strong>: String containing the HTML ID of the fieldset element for the default tab.
The default value is an empty string, which results in the first tab having the focus.
The fieldset's HTML ID typically takes the form of "edit-ARRAY_KEY".</p>

<p><strong>Usage example</strong>:</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'vertical_tabs'</span><span style="color: #007700">] = array(<br />    </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'vertical_tabs'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'#default_tab' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'edit-tab2'</span><span style="color: #007700">,<br />   );<br />  </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'tab1'</span><span style="color: #007700">] = array(<br />    </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'fieldset'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Tab 1'</span><span style="color: #007700">),<br />    </span><span style="color: #DD0000">'#collapsible' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'#group' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'vertical_tabs'</span><span style="color: #007700">,<br />  );<br />  </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'tab1'</span><span style="color: #007700">][</span><span style="color: #DD0000">'field1'</span><span style="color: #007700">] = array(<br />    </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Field 1'</span><span style="color: #007700">),<br />    </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'textfield'</span><span style="color: #007700">,<br />  );<br />  </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'tab2'</span><span style="color: #007700">] = array(<br />    </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'fieldset'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Tab 2'</span><span style="color: #007700">),<br />    </span><span style="color: #DD0000">'#collapsible' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'#group' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'vertical_tabs'</span><span style="color: #007700">,<br />  );<br />  </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'tab2'</span><span style="color: #007700">][</span><span style="color: #DD0000">'field2'</span><span style="color: #007700">] = array(<br />    </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Field 2'</span><span style="color: #007700">),<br />    </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'textfield'</span><span style="color: #007700">,<br />  );<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>


<h3><a name="default_value" id="default_value">#default_value</a></h3>

<p><strong>Used by</strong>:
<a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>,
<a href="#date">date</a>, <a href="#hidden">hidden</a>, <a href="#radio">radio</a>, <a href="#radios">radios</a>, <a href="#select">select</a>, <a href="#tableselect">tableselect</a>, <a href="#textarea">textarea</a>,
 <a href="#text_format">text_format</a>, <a href="#textfield">textfield</a>, <a href="#token">token</a>, <a href="#weight">weight</a></p>

<p><strong>Description</strong>: The value of the form element that
will be displayed or selected initially if the form has not been
submitted yet. <strong>Should NOT be confused with</strong> <strong><a href="#value">#value</a></strong>, which is a hard-coded value the
user cannot change!</p>

<p><strong>Values</strong>: Mixed</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/forum/forum.module">forum.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'body'</span><span class="g-txt">] = array(<br />
&nbsp;</span> <span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span>
<span class="r-txt">'textarea'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Body'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">body</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#required'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="delta" id="delta">#delta</a></h3>

<p><strong>Used by</strong>: <a href="#weight">weight</a></p>

<p><strong>Description</strong>:
Number of weights to have selectable. For example, with $delta =&gt;
10, the weight selection box would display numbers from -10 to 10.</p>

<p><strong>Values</strong>: A positive number</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/menu/menu.module">menu.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'weight'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'weight'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Weight'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$edit</span><span class="g-txt">[</span><span class="r-txt">'weight'</span><span class="g-txt">],</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#delta'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">10</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Optional.
In the menu, the heavier items will sink and the lighter items will be
positioned nearer the top.'</span><span class="g-txt">),<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="description" id="description">#description</a></h3>

<p><strong>Used by</strong>: <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#date">date</a>, <a href="#fieldset">fieldset</a>, <a href="#file">file</a>, <a href="#item">item</a>, <a href="#password">password</a>,
<a href="#password_confirm">password_confirm</a>, <a href="#radio">radio</a>,
<a href="#radios">radios</a>, <a href="#select">select</a>,  <a href="#text_format">text_format</a>, <a href="#textarea">textarea</a>, <a href="#textfield">textfield</a>, <a href="#weight">weight</a></p>

<p><strong>Description</strong>: The description of the form element.
Make sure to enclose inside the <a href="http://api.drupal.org/api/function/t">t</a>() function so this
property can be translated.</p>

<p><strong>Values</strong>: Mixed</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/menu/menu.module">menu.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'weight'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'weight'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Weight'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$edit</span><span class="g-txt">[</span><span class="r-txt">'weight'</span><span class="g-txt">],</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#delta'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">10</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Optional.
In the menu, the heavier items will sink and the lighter items will be
positioned nearer the top.'</span><span class="g-txt">),<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="disabled" id="disabled">#disabled</a></h3>

<p><strong>Used by</strong>: <a href="#button">button</a>, <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#date">date</a>, <a href="#file">file</a>, <a href="#image_button">image_button</a>, <a href="#password">password</a>,
<a href="#password_confirm">password_confirm</a>, <a href="#radio">radio</a>,
<a href="#radios">radios</a>, <a href="#select">select</a>, <a href="#submit">submit</a>,  <a href="#text_format">text_format</a>, <a href="#textarea">textarea</a>, <a href="#textfield">textfield</a>, <a href="#weight">weight</a></p>

<p><strong>Description</strong>: Disables (greys out) a form input
element. Setting #disabled to TRUE results in user input being ignored, regardless
of how the element is themed or whether JavaScript is used to change the
control's attributes.</p>

<p><strong>Values</strong>: TRUE or FALSE</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/system/system.module">system.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
&nbsp; &nbsp; &nbsp;</span> <span class="g-txt">if&nbsp;(isset(</span><span class="b-txt">$disabled</span><span class="g-txt">[</span><span class="b-txt">$name</span><span class="g-txt">]))&nbsp;{<br />
&nbsp; &nbsp; &nbsp; &nbsp;</span> <span class="b-txt">$form</span><span class="g-txt">[</span><span class="r-txt">'theme_settings'</span><span class="g-txt">][</span><span class="b-txt">$name</span><span class="g-txt">][</span><span class="r-txt">'#disabled'</span><span class="g-txt">]&nbsp;=&nbsp;</span><span class="b-txt">TRUE</span><span class="g-txt">;<br />
&nbsp; &nbsp; &nbsp; }<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="element_validate" id="element_validate">#element_validate</a></h3>

<p><strong>Used by</strong>: Any element.</p>

<p><strong>Description</strong>:
A list of custom validation functions. The validation functions must use form_error() or form_set_error() to flag the element as having an error if
the validation fails.</p>

<p><strong>Values</strong>: An array of function names to be called to
validate this element (and/or its children).</p>

<p>A validation function for an element takes $element, $form_state, and $form as parameters, and has the form:</p>

<div class="codeblock">
<code> <span class="g-txt">function </span><span class="b-txt">myelement_validate</span><span class="g-txt">(</span><span class="b-txt">$element</span><span class="g-txt">, &amp;</span><span class="b-txt">$form_state, $form</span><span class="g-txt">) {<br />&nbsp;&nbsp; if (empty(</span><span class="b-txt">$element</span><span class="g-txt">[</span><span class="r-txt">'#value'</span><span class="g-txt">])) {<br />&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="b-txt">form_error</span><span class="g-txt">(</span><span class="b-txt">$element</span><span class="g-txt">, </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'This field is required.'</span><span class="g-txt">));<br />&nbsp;&nbsp; }<br />}<br /></span> </code> </div>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/file/file.field.inc">file.field.inc</a>):</p>

<p><strong>Note:</strong> If you are altering an existing form element via
hook_form_alter() or a similar means, be careful with this property!
You will probably want to add to the existing array rather than writing
over it, so in that case don't follow this usage example exactly.</p>

<p>You'll notice that the validation function below includes only the first two arguments. $form is the same as $form_state['complete form'], so the third parameter is in fact contained in the second parameter.</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /> $form</span><span style="color: #007700">[</span><span style="color: #DD0000">'max_filesize'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'textfield'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Maximum upload size'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$settings</span><span style="color: #007700">[</span><span style="color: #DD0000">'max_filesize'</span><span style="color: #007700">],<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#description' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Enter a value like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes) in order to restrict the allowed file size. If left empty the file sizes will be limited only by PHP\'s maximum post and file upload sizes (current limit &lt;strong&gt;%limit&lt;/strong&gt;).'</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'%limit' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">format_size</span><span style="color: #007700">(</span><span style="color: #0000BB">file_upload_max_size</span><span style="color: #007700">()))),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#size' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">10</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#element_validate' </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">'_file_generic_settings_max_filesize'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#weight' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">5</span><span style="color: #007700">,<br />&nbsp; );<br />...<br />function </span><span style="color: #0000BB">_file_generic_settings_max_filesize</span><span style="color: #007700">(</span><span style="color: #0000BB">$element</span><span style="color: #007700">, &amp;</span><span style="color: #0000BB">$form_state</span><span style="color: #007700">) {<br />&nbsp; if (!empty(</span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'#value'</span><span style="color: #007700">]) &amp;&amp; !</span><span style="color: #0000BB">is_numeric</span><span style="color: #007700">(</span><span style="color: #0000BB">parse_size</span><span style="color: #007700">(</span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'#value'</span><span style="color: #007700">]))) {<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #0000BB">form_error</span><span style="color: #007700">(</span><span style="color: #0000BB">$element</span><span style="color: #007700">, </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'The "!name" option must contain a valid value. You may either leave the text field empty or enter a string like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes).'</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'!name' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'title'</span><span style="color: #007700">]))));<br />&nbsp; }<br />} <br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="empty" id="empty">#empty</a></h3>

<p><strong>Used by</strong>: <a href="#tableselect">tableselect</a></p>

<p><strong>Description</strong>: Text to display if the #options
property is empty.</p>

<p><strong>Values</strong>: Text, enclosed in the t() translation
function.</p>

<h3><a name="empty_option" id="empty_option">#empty_option</a></h3>

<p><strong>Used by</strong>: <a href="#select">select</a></p>

<p><strong>Description</strong>: The label to show for the initial option denoting
no selection in a select element. By default, the label is automatically set to
"- Select -" for a required field and "- None -" for an optional field.</p>

<p><strong>Values</strong>: Text, enclosed in the t() translation
function.</p>

<p><strong>Note:</strong> Use of this property plays a part in several possible
states for a select field:</p>
<ul>
<li>If <a href="#required">#required</a> is TRUE and there is no <a href="#default_value">#default_value</a>,
an empty option is added to the select control to force the user to make an active choice.</li>
<li>If <a href="#empty_value">#empty_value</a> or #empty_option is set and <a href="#required">#required</a>
is FALSE (default), an empty option is added to the select control, allowing the user to choose nothing.</li>
<li>If none of <a href="#required">#required</a>, <a href="#empty_value">#empty_value</a>, #empty_option,
and <a href="#default_value">#default_value</a> are set, then no empty option is added to the select control.
This leaves the control in a slightly illogical state, since all user agents automatically preselect the first
available option.There's no way for the user to select nothing, and the user is also not forced to make an active decision.</li>
</ul>

<h3><a name="empty_value" id="empty_value">#empty_value</a></h3>

<p><strong>Used by</strong>: <a href="#select">select</a></p>

<p><strong>Description</strong>: The value for the initial option denoting no selection
in a select element, which is used to determine whether the user submitted a value or not.</p>

<p><strong>Values</strong>: Defaults to empty string. Can be anything except NULL.</p>

<p><strong>Note:</strong> Use of this property plays a part in several possible
states for a select field:</p>
<ul>
<li>If <a href="#required">#required</a> is TRUE and there is no <a href="#default_value">#default_value</a>,
an empty option is added to the select control to force the user to make an active choice.</li>
<li>If #empty_value or <a href="#empty_option">#empty_option</a> is set and <a href="#required">#required</a>
is FALSE (default), an empty option is added to the select control, allowing the user to choose nothing.</li>
<li>If none of <a href="#required">#required</a>, #empty_value, <a href="#empty_option">#empty_option</a>,
and <a href="#default_value">#default_value</a> are set, then no empty option is added to the select control.
This leaves the control in a slightly illogical state, since all user agents automatically preselect the first
available option. There's no way for the user to select nothing, and the user is also not forced to make an active decision.</li>
</ul>

<h3><a name="error" id="error">#error</a></h3>

<p>INTERNAL. Indicates whether or not a form
element has been flagged
as having an error.</p>

<h3><a name="executes_submit_callback" id="executes_submit_callback">#executes_submit_callback</a></h3>

<p><strong>Used
by</strong>: <a href="#button">button</a>, <a href="#image_button">image_button</a>,
<a href="#submit">submit</a></p>

<p><strong>Description</strong>: Indicates whether or not the submit handler should be run when the form is submitted using this button element.</p>

<p><strong>Values</strong>: TRUE or FALSE</p>

<h3><a name="field_prefix" id="field_prefix">#field_prefix</a></h3>

<p><strong>Used by</strong>: <a href="#checkbox">checkbox</a>, <a href="#machine_name">machine_name</a>, <a href="#password">password</a>,
<a href="#password_confirm">password_confirm</a>, <a href="#radio">radio</a>,
<a href="#select">select</a>, <a href="#textarea">textarea</a>, <a href="#textfield">textfield</a></p>

<p><strong>Description</strong>: Text or code that is placed directly
in front of the textfield. This can be used to prefix a textfield with
a constant string.</p>

<p><strong>Values</strong>: Mixed</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/system/system.module">system.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'site_403'</span><span class="g-txt">]&nbsp;=&nbsp;array(<br />
&nbsp;&nbsp;</span><span class="r-txt">'#type'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="r-txt">'textfield'</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#title'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Default&nbsp;403&nbsp;(access&nbsp;denied)&nbsp;page'</span><span class="g-txt">),<br />
&nbsp;&nbsp;</span><span class="r-txt">'#default_value'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">variable_get</span><span class="g-txt">(</span><span class="r-txt">'site_403'</span><span class="g-txt">,&nbsp;</span><span class="r-txt">''</span><span class="g-txt">),<br />
&nbsp;&nbsp;</span><span class="r-txt">'#size'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">40</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#description'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'This&nbsp;page&nbsp;is&nbsp;displayed&nbsp;when&nbsp;the&nbsp;requested&nbsp;document&nbsp;is&nbsp;denied&nbsp;to&nbsp;the&nbsp;current&nbsp;user.&nbsp;If&nbsp;unsure,&nbsp;specify&nbsp;nothing.'</span><span class="g-txt">),<br />
&nbsp;&nbsp;</span><span class="r-txt">'#field_prefix'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">url</span><span class="g-txt">(</span><span class="b-txt">NULL</span><span class="g-txt">,&nbsp;</span><span class="b-txt">NULL</span><span class="g-txt">,&nbsp;</span><span class="b-txt">NULL</span><span class="g-txt">,&nbsp;</span><span class="b-txt">TRUE</span><span class="g-txt">)&nbsp;.&nbsp;(</span><span class="b-txt">variable_get</span><span class="g-txt">(</span><span class="r-txt">'clean_url'</span><span class="g-txt">,&nbsp;</span><span class="b-txt">0</span><span class="g-txt">)&nbsp;?&nbsp;</span><span class="r-txt">''&nbsp;</span><span class="g-txt">:&nbsp;</span><span class="r-txt">'?q='</span><span class="g-txt">)<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="field_suffix" id="field_suffix">#field_suffix</a></h3>

<p><strong>Used by</strong>: <a href="#checkbox">checkbox</a>, <a href="#machine_name">machine_name</a>, <a href="#password">password</a>,
<a href="#password_confirm">password_confirm</a>, <a href="#radio">radio</a>,
<a href="#select">select</a>, <a href="#textarea">textarea</a>, <a href="#textfield">textfield</a></p>

<p><strong>Description</strong>: Text or code that is placed directly
after a textfield. This can be used to add a unit to a textfield.</p>

<p><strong>Values</strong>: Mixed</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/upload/upload.module">system.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'settings_general'</span><span class="g-txt">][</span><span class="r-txt">'upload_usersize_default'</span><span class="g-txt">]&nbsp;=&nbsp;array(<br />
&nbsp;&nbsp;</span><span class="r-txt">'#type'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="r-txt">'textfield'</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#title'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Default&nbsp;total&nbsp;file&nbsp;size&nbsp;per&nbsp;user'</span><span class="g-txt">),<br />
&nbsp;&nbsp;</span><span class="r-txt">'#default_value'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">$upload_usersize_default</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#size'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">5</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#maxlength'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">5</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#description'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'The&nbsp;default&nbsp;maximum&nbsp;size&nbsp;of&nbsp;all&nbsp;files&nbsp;a&nbsp;user&nbsp;can&nbsp;have&nbsp;on&nbsp;the&nbsp;site.'</span><span class="g-txt">),<br />
&nbsp;&nbsp;</span><span class="r-txt">'#field_suffix'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'MB'</span><span class="g-txt">)<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="group" id="group">#group</a></h3>

<p><strong>Used by</strong>: <a href="#fieldset">fieldset</a></p>

<p><strong>Description</strong>: Specifies a group that can be used to
group fieldsets into vertical tabs.</p>

<p><strong>Values</strong>:
A string where the value is used for the id of a form element with the
#type of vertical_tabs.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/drupal/modules--user--user.admin.inc">user.admin.inc</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'email'</span><span class="g-txt">]&nbsp;=&nbsp;array(<br />
&nbsp;&nbsp;</span><span class="r-txt">'#type'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="r-txt">'vertical_tabs'</span><span class="g-txt">,<br />
);<br />
...<br />
</span> <span class="b-txt"> $form</span><span class="g-txt">[</span><span class="r-txt">'email_admin_created'</span><span class="g-txt">]&nbsp;=&nbsp;array(<br />
&nbsp;&nbsp;</span><span class="r-txt">'#type'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="r-txt">'fieldset'</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#title'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Welcome&nbsp;(new&nbsp;user&nbsp;created&nbsp;by&nbsp;administrator)'</span><span class="g-txt">),<br />
&nbsp;&nbsp;</span><span class="r-txt">'#collapsible'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">TRUE</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#collapsed'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">(variable_get('user_register',&nbsp;1)&nbsp;!=&nbsp;0)</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#description'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Edit&nbsp;the&nbsp;welcome&nbsp;e-mail&nbsp;messages&nbsp;sent&nbsp;to&nbsp;new&nbsp;member&nbsp;accounts&nbsp;created&nbsp;by&nbsp;an&nbsp;administrator.'</span><span class="g-txt">),<br />
&nbsp;&nbsp;</span><span class="r-txt">'#group'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="r-txt">'email'</span><span class="g-txt"><br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="header_prop" id="header_prop">#header</a></h3>

<p><strong>Used by</strong>: <a href="#tableselect">tableselect</a></p>

<p><strong>Description</strong>: Column headers.</p>

<p><strong>Values</strong>:
Associative array where the keys are the field names to use for each
column, and the values are the translated text to display for each
column header.</p>

<h3><a name="id" id="id">#id</a></h3>

<p><strong>Description</strong>: Internal. Used to populate form elements' id property. In rare
cases, you can set this value yourself on a form element, to override
the default setting.</p>

<p><strong>Value</strong>: HTML id string.</p>

<h3><a name="input" id="input">#input</a></h3>

<p>INTERNAL. Indicates whether or not input
is possible for this form
element.</p>

<h3><a name="js_select" id="js_select">#js_select</a></h3>

<p><strong>Used by</strong>: <a href="#tableselect">tableselect</a></p>

<p><strong>Description</strong>: Whether to include a select all
checkbox.</p>

<p><strong>Values</strong>:
TRUE to add a select all box to each row of the table, FALSE to omit
the select all box. Only applies if #multiple is also TRUE.</p>

<h3><a name="limit_validation_errors" id="limit_validation_errors">#limit_validation_errors</a></h3>

<p><strong>Used
by</strong>: <a href="#button">button</a>, <a href="#image_button">image_button</a>,
<a href="#submit">submit</a></p>

<p><strong>Description</strong>: Provides an array of sections which
are parts of $form_state['values'] which should be validated, implying
that sections which are not listed should not be validated. This is
normally used in multistep forms in the case of a "back" button, for
example, where '#limit_validation_errors' =&gt; array() would mean not
to validate anything as form values
on the current page are to be discarded anyway. <em>#limit_validation_errors
does not
have any effect if #submit is not set.</em> More discussion is in
the <a href="http://api.drupal.org/api/function/form_set_error">form_set_error()
documentation</a>.<br />
</p>

<p><strong>Values</strong>: array indicating sections of the
$form_state['values'] which should be validated.<br />
</p>

<h3><a name="markup-attribute" id="markup-attribute">#markup</a></h3>

<p><strong>Used by</strong>:
<a href="#item">item</a>, <a href="#markup">markup</a></p>

<p><strong>Description</strong>: Used to set HTML that will be output
on the form.</p>

<p><strong>Values</strong>: Text (valid HTML)</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/contact/contact.pages.inc">contact.module</a>):</p>

<div class="codeblock"> <code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 187);">&lt;?php<br />
&nbsp; $form</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'from'</span><span style="color: rgb(0, 119, 0);">] = array(<br />
&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(221, 0, 0);">'#type'
</span><span style="color: rgb(0, 119, 0);">=&gt; </span><span style="color: rgb(221, 0, 0);">'item'</span><span style="color: rgb(0, 119, 0);">,<br />
&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(221, 0, 0);">'#title'
</span><span style="color: rgb(0, 119, 0);">=&gt; </span><span style="color: rgb(0, 0, 187);">t</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(221, 0, 0);">'From'</span><span style="color: rgb(0, 119, 0);">),<br />
&nbsp;&nbsp;&nbsp; </span><span style="color: rgb(221, 0, 0);">'#markup'
</span><span style="color: rgb(0, 119, 0);">=&gt; </span><span style="color: rgb(0, 0, 187);">check_plain</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$user</span><span style="color: rgb(0, 119, 0);">-&gt;</span><span style="color: rgb(0, 0, 187);">name</span><span style="color: rgb(0, 119, 0);">) . </span><span style="color: rgb(221, 0, 0);">' &amp;lt;' </span><span style="color: rgb(0, 119, 0);">. </span><span style="color: rgb(0, 0, 187);">check_plain</span><span style="color: rgb(0, 119, 0);">(</span><span style="color: rgb(0, 0, 187);">$user</span><span style="color: rgb(0, 119, 0);">-&gt;</span><span style="color: rgb(0, 0, 187);">mail</span><span style="color: rgb(0, 119, 0);">) . </span><span style="color: rgb(221, 0, 0);">'&amp;gt;'</span><span style="color: rgb(0, 119, 0);">,<br />
&nbsp; );<br />
</span><span style="color: rgb(0, 0, 187);">?&gt;</span></span></code> </div>

<h3><a name="maxlength" id="maxlength">#maxlength</a></h3>

<p><strong>Used by</strong>: <a href="#password">password</a>, <a href="#textfield">textfield</a></p>

<p><strong>Description</strong>: The maximum amount of characters to
accept as input.</p>

<p><strong>Values</strong>: A positive number.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/forum/forum.module">forum.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'title'</span><span class="g-txt">] = array(<br />
&nbsp;</span> <span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span>
<span class="r-txt">'textfield'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Subject'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">title</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#size'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#maxlength'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">128</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#required'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="method" id="method">#method</a></h3>

<p><strong>Used by</strong>: <a href="#form">form</a></p>

<p><strong>Description</strong>: The HTTP method with which the form
will be submitted.</p>

<p><strong>Values</strong>: <code>get</code> or <code>post</code>. Default is <code>post</code>.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/node/node.module">node.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'#method'</span><span class="g-txt">] =</span> <span class="r-txt">'post'</span><span class="g-txt">;<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="multiple" id="multiple">#multiple</a></h3>

<p><strong>Used by</strong>: <a href="#select">select</a>, <a href="#tableselect">tableselect</a></p>

<p><strong>Description</strong>: Indicates whether the user may select
more than one item.</p>

<p><strong>Values</strong>: TRUE or FALSE</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/taxonomy/taxonomy.module">taxonomy.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
</span> <span class="g-txt">return array(</span><span class="r-txt"><br />
&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'select'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$title</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$value</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#options'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$options</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$description</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#multiple'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$multiple</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#size'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$multiple</span> <span class="g-txt">?</span><span class="r-txt"> </span><span class="b-txt">min</span><span class="g-txt">(</span><span class="b-txt">12</span><span class="g-txt">,</span>
<span class="b-txt">count</span><span class="g-txt">(</span><span class="b-txt">$options</span><span class="g-txt">)) </span><span class="g-txt">:</span> <span class="b-txt">0</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#weight'</span> <span class="g-txt">=&gt; -</span><span class="b-txt">15</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="name" id="name">#name</a></h3>

<p><strong>Used by</strong>: <a href="#button">button</a>, <a href="#submit">submit</a>, <a href="#file">file</a></p>

<p><strong>Description</strong>: The name attribute of the corresponding HTML element. This can be used in element types such as <a href="#submit">submit</a>, <a href="#button">button</a> and <a href="#file">file</a> to override the default setting.</p>

<p><strong>Values</strong>: String.</p>

<h3><a name="options" id="options">#options</a></h3>

<p><strong>Used by</strong>: <a href="#checkboxes">checkboxes</a>, <a href="#radios">radios</a>, <a href="#select">select</a>, <a href="#tableselect">tableselect</a></p>

<p><strong>Description</strong>: Selectable options for a form element that allows multiple choices.</p>

<p><strong>Values</strong>: An array in the form of <code>array(t('Display value 1'), t('Display value 2'))</code> or <code>array('return_value1' =&gt; t('Display Value 1'), 'return_value2' =&gt; t('Display Value 2'))</code>
if specific return values are required. If returned values are identical to displayed values, you can use <a href="http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_map_assoc">drupal_map_assoc()</a> as in the example below.
The #options property needs special handling for checkboxes, and works completely differently for tableselect. See the respective element descriptions for details.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/examples/form_example--form_example_states.inc">form_example_states.inc</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'undergraduate'</span><span style="color: #007700">][</span><span style="color: #DD0000">'school_country'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'select'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">drupal_map_assoc</span><span style="color: #007700">(array(</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'UK'</span><span style="color: #007700">), </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Other'</span><span style="color: #007700">))),<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'In what country is your college or university located?'</span><span style="color: #007700">),<br />&nbsp;&nbsp;);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>


<h3><a name="parents" id="parents">#parents</a></h3>

<p><strong>Used by</strong>: All</p>

<p><strong>Description</strong>:
Identifies parent form elements. See <a href="http://drupal.org/node/48643">#tree and #parents</a> in the
handbook and the <a href="http://drupal.org/node/279246#comment-2292322">complete comparison between #parents and #array_parents</a>.</p>

<p><strong>Values</strong>: An array of element names.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/comment/comment.module">comment.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'admin'</span><span class="g-txt">][</span><span class="r-txt">'status'</span><span class="g-txt">] = array(<br />
&nbsp;</span> <span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span>
<span class="r-txt">'radios'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#parents'</span> <span class="g-txt">=&gt; array(</span><span class="r-txt">'status'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Status'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$status</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#options'</span> <span class="g-txt">=&gt; array(</span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Published'</span><span class="g-txt">),</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Not published'</span><span class="g-txt">)),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#weight'</span> <span class="g-txt">=&gt; -</span><span class="b-txt">1</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="post_render" id="post_render">#post_render</a></h3>

<p><strong>Used by</strong>: All elements and forms</p>

<p><strong>Description</strong>:
Function(s) to call <strong>after</strong>
rendering in <a href="http://api.drupal.org/api/function/drupal_render/" class="local">drupal_render</a>()
has occured. The named function is called with two arguments, the rendered element and its children. It returns the (potentially)
altered) element content.</p>

<p><strong>Values</strong>: An array of function names to call.</p>

<p><strong>Usage example</strong>:</p>

<p><strong>Note:</strong> If you are altering an existing form via
hook_form_alter() or a similar means, be careful with this property!
You will probably want to add to the existing array rather than writing
over it, so don't follow this usage example exactly.</p>

<div class="codeblock"><code><span class="def-txt"> <span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'admin'</span><span class="g-txt">][</span><span class="r-txt">'#post_render'</span><span class="g-txt">] = array(</span><span class="r-txt">'admin_form_html_cleanup'</span><span class="g-txt">);<br />
</span><span class="b-txt">?&gt;</span></span></code>
<p>This example would call admin_form_html_cleanup($content, $element)
after $element has been rendered to $content via <a href="http://api.drupal.org/api/function/drupal_render/" class="local">drupal_render</a>().
$content may then be modified and must be returned.</p>
</div>

<h3><a name="prefix" id="prefix">#prefix</a></h3>

<p><strong>Used by</strong>: All elements and forms.</p>

<p><strong>Description</strong>: Text or
markup to include before the
form element. Also see <a href="#suffix">#suffix</a>.</p>

<p><strong>Values</strong>: Mixed</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/poll/poll.module">poll.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'choice'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp; '#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'fieldset'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Choices'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#prefix'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'&lt;div class="poll-form"&gt;'</span><span class="g-txt">,</span>
<span class="r-txt"><br />
&nbsp;&nbsp;'#suffix'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'&lt;/div&gt;'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#tree'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="pre_render" id="pre_render">#pre_render</a></h3>

<p><strong>Used by</strong>: All elements and forms.</p>

<p><strong>Description</strong>:
Function(s) to call <strong>before</strong>
rendering in <a href="http://api.drupal.org/api/function/drupal_render/" class="local">drupal_render</a>()
has occured. The function(s) provided in #pre_render receive the element as an argument and
must return the altered element.</p>

<p><strong>Values</strong>: An array of function names to call.</p>

<p><strong>Usage example (filter.module)</strong>:</p>

<p><strong>Note:</strong> If you are altering an existing form via
hook_form_alter() or a similar means, be careful with this property!
As demonstrated here, you will probably want to add to the existing array rather than writing
over it.</p>

<div class="codeblock"><code>
// Prepend #pre_render callback to replace field value with user notice<br />
// prior to rendering.<br />
if (!isset($element['value']['#pre_render'])) {<br />
&nbsp;&nbsp;$element['value']['#pre_render'] = array();<br />
}<br />
array_unshift($element['value']['#pre_render'], 'filter_form_access_denied');<br />
<br />
...<br />
function filter_form_access_denied($element) {<br />
&nbsp;&nbsp;$element['#value'] = t('This field has been disabled because you do not have sufficient permissions to edit it.');<br />
&nbsp;&nbsp;return $element;<br />
}<br />
</code>
<p>This example would call filter_form_access_denied($element) before
the $element has been rendered via <a href="http://api.drupal.org/api/function/drupal_render/" class="local">drupal_render</a>().
$element may then be modified and is returned for rendering.</p>
</div>

<h3><a name="printed" id="printed">#printed</a></h3>

<p>INTERNAL. Used to determine whether
or not a form element has been
printed yet.</p>

<h3><a name="process">#process</a></h3>

<p><strong>Used by</strong>: All</p>

<p><strong>Description</strong>:
An array of functions that are called when an element is processed.
Using this callback, modules can "register" further actions. For
example, the "radios" form type is expanded to multiple radio buttons
using a processing function.</p>

<p><strong>Values</strong>: Array of function names (strings)</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/system/system.module">system.module</a>)
in <code>system_element_info()</code>:</p>

<p><strong>Note:</strong> If you are altering an existing form via
hook_form_alter() or a similar means, be careful with this property!
You will probably want to add to the existing array rather than writing
over it, so don't follow this usage example exactly.</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$types</span><span style="color: #007700">[</span><span style="color: #DD0000">'radios'</span><span style="color: #007700">] = array(<br />    </span><span style="color: #DD0000">'#input' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">, <br />    </span><span style="color: #DD0000">'#process' </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">'form_process_radios'</span><span style="color: #007700">), <br />    </span><span style="color: #DD0000">'#theme_wrappers' </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">'radios'</span><span style="color: #007700">), <br />    </span><span style="color: #DD0000">'#pre_render' </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">'form_pre_render_conditional_form_element'</span><span style="color: #007700">),<br />  );<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
<p>In this example, the function <code>form_process_radios</code> is called;
the entire radios element is passed in as the argument. This function
expands a radios element into individual radio buttons.
</p>
</div>

<h3><a name="processed" id="processed">#processed</a></h3>

<p>INTERNAL. Used to ascertain
whether or not a form element has been
processed (ie: expanded to multiple elements).</p>

<h3><a name="required" id="required">#required</a></h3>

<p><strong>Used by</strong>: <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#date">date</a>, <a href="#file">file</a>, <a href="#password">password</a>,
<a href="#password_confirm">password_confirm</a>, <a href="#radio">radio</a>,
<a href="#radios">radios</a>, <a href="#select">select</a>,  <a href="#text_format">text_format</a>, <a href="#textarea">textarea</a>, <a href="#textfield">textfield</a>, <a href="#weight">weight</a></p>

<p><strong>Description</strong>:
Indicates whether or not the element is required. This automatically
validates for empty fields, and flags inputs as required. File fields
are <strong>NOT</strong> allowed to be required.</p>

<p><strong>Values</strong>: TRUE or FALSE</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/forum/forum.module">forum.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'title'</span><span class="g-txt">] = array(<br />
&nbsp;</span> <span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span>
<span class="r-txt">'textfield'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Subject'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">title</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#size'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#maxlength'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">128</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#required'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="resizable" id="resizable">#resizable</a></h3>

<p><strong>Used by</strong>:  <a href="#text_format">text_format</a>, <a href="#textarea">textarea</a></p>

<p><strong>Description</strong>: Whether users should be allowed to resize the text area</p>

<p><strong>Values</strong>: TRUE or FALSE</p>

<h3><a name="return_value" id="return_value">#return_value</a></h3>

<p><strong>Used by</strong>: <a href="#checkbox">checkbox</a>, <a href="#image_button">image_button</a>,
<a href="#radio">radio</a></p>

<p><strong>Description</strong>: Value element should return when
selected</p>

<p><strong>Values</strong>: Mixed</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/poll/poll.module">poll.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'morechoices'</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;</span><span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'checkbox'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Need
more choices'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#return_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">1</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">0</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">"If
the amount of boxes above isn't enough, check this box and click the
Preview button below to add some more."</span><span class="g-txt">),<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="rows" id="rows">#rows</a></h3>

<p><strong>Used by</strong>:  <a href="#text_format">text_format</a>, <a href="#textarea">textarea</a></p>

<p><strong>Description</strong>: How many rows high the textarea should
be (see also <a href="#cols">#cols</a>)</p>

<p><strong>Values</strong>: A positive number</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/aggregator/aggregator.module">aggregator.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'description'</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;</span><span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'textarea'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Description'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$edit</span><span class="g-txt">[</span><span class="r-txt">'description'</span><span class="g-txt">],</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#cols'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#rows'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">5</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="size" id="size">#size</a></h3>

<p><strong>Used by</strong>: <a href="#file">file</a>, <a href="#password">password</a>, <a href="#password_confirm">password_confirm</a>,
<a href="#select">select</a>,
<a href="#textfield">textfield</a></p>

<p><strong>Description</strong>: Width of the textfield (in characters)
or size of multiselect box (in lines).</p>

<p><strong>Values</strong>: A positive number.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/comment/comment.module">comment.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
&nbsp; &nbsp; &nbsp; &nbsp; $form</span><span class="g-txt">[</span><span class="r-txt">'admin'</span><span class="g-txt">][</span><span class="r-txt">'homepage'</span><span class="g-txt">] = array(<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span> <span class="r-txt">'#type'</span><span class="g-txt">=&gt;</span> <span class="r-txt">'textfield'</span><span class="g-txt">,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span> <span class="r-txt">'#title'</span><span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Homepage'</span><span class="g-txt">),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span> <span class="r-txt">'#maxlength'</span><span class="g-txt">=&gt;</span> <span class="b-txt">255</span><span class="g-txt">,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span> <span class="r-txt">'#size'</span><span class="g-txt">=&gt;</span> <span class="b-txt">30</span><span class="g-txt">,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span> <span class="r-txt">'#default_value'</span><span class="g-txt">=&gt;</span> <span class="b-txt">$edit</span><span class="g-txt">[</span><span class="r-txt">'homepage'</span><span class="g-txt">],<br />&nbsp; &nbsp; &nbsp; &nbsp; );<br /></span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="src" id="src">#src</a></h3>

<p><strong>Used by</strong>: <a href="#image_button">image_button</a><br /></p>

<p><strong>Description</strong>:&nbsp; The URL of the image of the button.</p>

<p><strong>Values</strong>: A URL.</p>

<h3><a name="states" id="states">#states</a></h3>

<p><strong>Used by</strong>: any element<br /></p>

<p><strong>Description</strong>:&nbsp; Adds JavaScript to the element
to allow it to have different active states.</p>

<p><strong>Values</strong>: A structured array describing the different
JavaScript states that can be applied to
the element when certain conditions are met. Please read the extensive
description of this feature at <a href="http://api.drupal.org/api/function/drupal_process_states">drupal_process_states().</a><br />
</p>

<p><strong>Usage example</strong></p>

<div class="codeblock">
<code>$form['email_canceled']['settings'] = array(<br />&nbsp;&nbsp;&nbsp; '#type' =&gt; 'container',<br />&nbsp;&nbsp;&nbsp; '#states' =&gt; array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Hide the settings when the cancel notify checkbox is disabled.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'invisible' =&gt; array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;':input[name="email_canceled_toggle"]' =&gt; array('checked' =&gt; FALSE),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br />&nbsp;&nbsp;&nbsp; ),<br />&nbsp; );
</code></div>

<h3><a name="submit_property" id="submit_property">#submit</a></h3>

<p><strong>Used by</strong>: <a href="#button">button</a>, <a href="#image_button">image_button</a>, <a href="#submit">submit</a>, <a href="#form">form</a></p>

<p><strong>Description</strong>:&nbsp; A list of custom submit functions that will be called when the element is submitted. This is usually to add additional submit functions to a form, or to use an alternate function rather than the default form submission function which is the form ID with <em>_submit</em> appended to it.</p>
<p><strong>Values</strong>: An array of function names. Each such function will take $form and $form_state as parameters.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/function/node_form/6">node_form()</a>):</p>

<div class="codeblock">
<code>
  if (!empty($node-&gt;nid) &amp;&amp; node_access(&#x27;delete&#x27;, $node)) {<br />
  &nbsp;$form[&#x27;actions&#x27;][&#x27;delete&#x27;] = array(<br />
  &nbsp;&nbsp;&#x27;#type&#x27; =&gt; &#x27;submit&#x27;,<br />
  &nbsp;&nbsp;&#x27;#value&#x27; =&gt; t(&#x27;Delete&#x27;),<br />
  &nbsp;&nbsp;&#x27;#weight&#x27; =&gt; 15,<br />
  &nbsp;&nbsp;&#x27;#submit&#x27; =&gt; array(&#x27;node_form_delete_submit&#x27;),<br />
  &nbsp;);<br />
</code>
</div>

<h3><a name="suffix" id="suffix">#suffix</a></h3>

<p><strong>Used by</strong>: All elements and forms.</p>

<p><strong>Description</strong>: Text or
markup to include after the
form element. Also see <a href="#prefix">#prefix</a>.</p>

<p><strong>Values</strong>: Mixed</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/poll/poll.module">poll.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'choice'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp; '#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'fieldset'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Choices'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#prefix'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'&lt;div class="poll-form"&gt;'</span><span class="g-txt">,</span>
<span class="r-txt"><br />
&nbsp;&nbsp;'#suffix'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'&lt;/div&gt;'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#tree'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="theme" id="theme">#theme</a></h3>

<p><strong>Used by</strong>: All elements and forms.</p>

<p><strong>Description</strong>: Theme
function to call for element. It
must render this element and all of its child elements.</p>

<p><strong>Values</strong>: The name of a theme function, without the initial 'theme_'.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/node/node.module">node.module</a>):</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$data</span><span style="color: #007700">[</span><span style="color: #DD0000">'actions'</span><span style="color: #007700">][</span><span style="color: #DD0000">'output'</span><span style="color: #007700">][] = array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#theme' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'menu_local_action'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#link' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$item</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="theme_wrappers" id="theme_wrappers">#theme_wrappers</a></h3>

<p><strong>Used by</strong>: All elements and forms.</p>

<p><strong>Description</strong>:
Theme function to call for element,
after the element and children are rendered, but before the <a href="#post_render">#post_render</a> functions are called.</p>

<p><strong>Values</strong>: The name of a theme function, without the
initial 'theme_'.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/system/system.module">system.module</a>
from definition of default properties for a form):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$type<span class="g-txt">[</span><span class="r-txt">'form'</span><span class="g-txt">] = array(</span><span class="r-txt">'#theme_wrappers'</span><span class="g-txt"> =&gt; array(</span><span class="r-txt">'form'</span><span class="g-txt">));</span>
<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="title" id="title">#title</a></h3>

<p><strong>Used by</strong>: <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#date">date</a>, <a href="#fieldset">fieldset</a>, <a href="#file">file</a>, <a href="#item">item</a>, <a href="#password">password</a>,
<a href="#password_confirm">password_confirm</a>, <a href="#radio">radio</a>,
<a href="#radios">radios</a>, <a href="#select">select</a>,  <a href="#text_format">text_format</a>, <a href="#textarea">textarea</a>, <a href="#textfield">textfield</a>, <a href="#weight">weight</a></p>

<p><strong>Description</strong>: The title of the form element. Make
sure to enclose inside the <a href="http://api.drupal.org/api/function/t">t</a>() function so this
property can be translated.</p>

<p><strong>Values</strong>: Mixed</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/aggregator/aggregator.module">aggregator.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'description'</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;</span><span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'textarea'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Description'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$edit</span><span class="g-txt">[</span><span class="r-txt">'description'</span><span class="g-txt">],</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#cols'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#rows'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">5</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="title_display" id="title_display">#title_display</a></h3>

<p><strong>Used by</strong>: <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#date">date</a>, <a href="#fieldset">fieldset</a>, <a href="#file">file</a>, <a href="#item">item</a>, <a href="#password">password</a>,
<a href="#password_confirm">password_confirm</a>, <a href="#radio">radio</a>,
<a href="#radios">radios</a>, <a href="#select">select</a>, <a href="#text_format">text_format</a>, <a href="#textarea">textarea</a>, <a href="#textfield">textfield</a>, <a href="#weight">weight</a></p>

<p><strong>Description</strong>: Indicates how the label should be rendered. The label includes the #title and the required marker, if #required. If the #title is empty but the field is #required, the label will contain only the required marker.</p>

<p><strong>Values</strong>: String.</p>

<p>Possible values:</p>
<ul>
  <li><strong>before</strong>: The label is output before the element. This is the default for most elements.</li>
  <li><strong>after</strong>: The label is output after the element. For example, this is used for radio and checkbox #type elements as set in system_elements().</li>
  <li><strong>invisible</strong>: #title is rendered as a label element before the form element in the page markup, and is made invisible with the Drupal 7 .element-invisible system CSS class (system.base.css). This makes #title remain available to screen-reader users, but hides it from being displayed visually in the browser.</li>
  <li><strong>attribute</strong>: Set the title attribute on the element to create a tooltip but output no label element. This is supported only for checkboxes and radios in form_pre_render_conditional_form_element(). It is used where a visual label is not needed, such as a table of checkboxes where the row and column provide the context. The tooltip will include the title and required marker.</li>
</ul>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/block/block.module">block.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'blocks'</span><span class="g-txt">][</span><span class="b-txt">$key</span><span class="g-txt">][</span><span class="r-txt">'weight'</span><span class="g-txt">] = array(</span><br />
&nbsp;<span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'weight'</span><span class="g-txt">,</span><br />
&nbsp;<span class="r-txt">'#default_value'</span> <span class="g-txt">=&gt; </span><span class="b-txt">$block</span><span class="g-txt">[</span><span class="r-txt">'weight'</span><span class="g-txt">],</span><br />
&nbsp;<span class="r-txt">'#delta'</span> <span class="g-txt">=&gt; </span><span class="b-txt">$weight_delta</span><span class="g-txt">,</span><br />
&nbsp;<span class="r-txt">'#title_display'</span> <span class="g-txt">=&gt; </span><span class="r-txt">'invisible'</span><span class="g-txt">,</span><br />
&nbsp;<span class="r-txt">'#title'</span> <span class="g-txt">=&gt; </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Weight for @block block'</span><span class="g-txt">, array(</span><span class="r-txt">'@block'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$block</span><span class="g-txt">[</span><span class="r-txt">'info'</span><span class="g-txt">])),<br />
);</span><br />
<span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="tree" id="tree">#tree</a></h3>

<p><strong>Used by</strong>: All</p>

<p><strong>Description</strong>:
Used to allow collections of form elements. Normally applied to the
"parent" element, as the #tree property cascades to sub-elements. Use
where you previously used ][ in form_ calls. For more information, see <a href="http://drupal.org/node/48643">#tree and #parents</a> in the
handbook.</p>

<p><strong>Values</strong>: TRUE or FALSE</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/system/system.module">system.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'status'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp; '#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'checkboxes'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$status</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#options'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$options</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#tree'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span> <span class="b-txt">$required</span> <span class="g-txt">=
array(</span><span class="r-txt">'block'</span><span class="g-txt">,</span>
<span class="r-txt">'filter'</span><span class="g-txt">,</span> <span class="r-txt">'system'</span><span class="g-txt">,</span> <span class="r-txt">'user'</span><span class="g-txt">,</span> <span class="r-txt">'watchdog'</span><span class="g-txt">);<br />
foreach (</span><span class="b-txt">$required</span> <span class="g-txt">as</span> <span class="b-txt">$require</span><span class="g-txt">) {<br />
</span> <span class="b-txt">&nbsp;&nbsp;$form</span><span class="g-txt">[</span><span class="r-txt">'status'</span><span class="g-txt">][</span><span class="b-txt">$require</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp;&nbsp;&nbsp; '#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'hidden'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;&nbsp;&nbsp;'#value'</span> <span class="g-txt">=&gt;</span>
<span class="b-txt">1</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;&nbsp;&nbsp;'#suffix'</span> <span class="g-txt">=&gt;</span>
<span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'required'</span><span class="g-txt">),<br />
&nbsp;&nbsp;);<br />
}<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="type" id="type">#type</a></h3>

<p><strong>Used by</strong>: All</p>

<p><strong>Description</strong>: Used to
determine the type of form
element.</p>

<p><strong>Values</strong>: <a href="#button">button</a>, <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#date">date</a>, <a href="#fieldset">fieldset</a>, <a href="#file">file</a>, <a href="#form">form</a>, <a href="#hidden">hidden</a>,
<a href="#image_button">image_button</a>, <a href="#item">item</a>, <a href="#machine_name">machine_name</a>, <a href="#markup">markup</a>, <a href="#password">password</a>, <a href="#password_confirm">password_confirm</a>, <a href="#radio">radio</a>,
<a href="#radios">radios</a>, <a href="#select">select</a>, <a href="#submit">submit</a>, <a href="#tableselect">tableselect</a>, <a href="#textarea">textarea</a>, <a href="#textfield">textfield</a>, <a href="#token">token</a>, <a href="#val">value</a>, <a href="#vertical_tabs">vertical_tabs</a>, <a href="#weight">weight</a></p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/locale/locale.module">locale.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'submit'</span><span class="g-txt">] = array(</span><span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'submit'</span><span class="g-txt">,</span> <span class="r-txt">'#value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Import'</span><span class="g-txt">));<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="validate" id="validate">#validate</a></h3>

<p><strong>Used by</strong>:
<a href="#button">button</a>,
<a href="#image_button">image_button</a>, <a href="#form">form</a>, <a href="#submit">submit</a></p>

<p><strong>Description</strong>:
A list of custom validation functions that need to be passed.This is
usually used to add additional validation functions to a form, or to
use an alternate function rather than the default form validation
function which is the form ID with <em>_validate</em> appended to it.</p>

<p><strong>Values</strong>:
An array of function names. Each such function will take $form and
$form_state as parameters and should use form_set_error() if the form
values do not pass validation. For example:</p>

<div class="codeblock"> <code> <span class="g-txt">function </span><span class="b-txt">test_form_validate</span><span class="g-txt">(</span><span class="b-txt">$form</span><span class="g-txt">, </span><span class="b-txt">&amp;$form_state</span><span class="g-txt">) {<br />
&nbsp;&nbsp;if (</span><span class="b-txt">$form_state['values']</span><span class="g-txt">[</span><span class="r-txt">'name'</span><span class="g-txt">] == </span><span class="r-txt">''</span><span class="g-txt">) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="b-txt">form_set_error</span><span class="g-txt">(</span><span class="r-txt">'name'</span><span class="g-txt">, </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'You must select a name for this group of settings.'</span><span class="g-txt">));<br />
&nbsp;&nbsp;}<br />
}</span> </code> </div>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/node/node.module">node.module</a>):</p>

<p><strong>Note:</strong> If you are altering an existing form via
hook_form_alter() or a similar means, be careful with this property!
You will probably want to add to the existing array rather than writing
over it, so don't follow this usage example exactly.</p>

<div class="codeblock"> <code> <span class="def-txt"><span class="b-txt">&lt;?php<br />
&nbsp;&nbsp;&nbsp; </span><span class="y-txt">// Node types:<br />
&nbsp;&nbsp;&nbsp; </span><span class="b-txt">$types </span><span class="g-txt">= </span><span class="b-txt">array_map</span><span class="g-txt">(</span><span class="r-txt">'check_plain'</span><span class="g-txt">, </span><span class="b-txt">node_get_types</span><span class="g-txt">(</span><span class="r-txt">'names'</span><span class="g-txt">));<br />
&nbsp;&nbsp;&nbsp; </span><span class="b-txt">$form</span><span class="g-txt">[</span><span class="r-txt">'advanced'</span><span class="g-txt">][</span><span class="r-txt">'type'</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#type' </span><span class="g-txt">=&gt; </span><span class="r-txt">'checkboxes'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#title' </span><span class="g-txt">=&gt; </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Only of the type(s)'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#prefix' </span><span class="g-txt">=&gt; </span><span class="r-txt">'&lt;div
class="criterion"&gt;'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#suffix' </span><span class="g-txt">=&gt; </span><span class="r-txt">'&lt;/div&gt;'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#options' </span><span class="g-txt">=&gt; </span><span class="b-txt">$types</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp; );<br />
&nbsp;&nbsp;&nbsp; </span><span class="b-txt">$form</span><span class="g-txt">[</span><span class="r-txt">'advanced'</span><span class="g-txt">][</span><span class="r-txt">'submit'</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#type' </span><span class="g-txt">=&gt; </span><span class="r-txt">'submit'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#value' </span><span class="g-txt">=&gt; </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Advanced search'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#prefix' </span><span class="g-txt">=&gt; </span><span class="r-txt">'&lt;div
class="action"&gt;'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#suffix' </span><span class="g-txt">=&gt; </span><span class="r-txt">'&lt;/div&gt;'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp; );<br />
<br />
&nbsp;&nbsp;&nbsp; </span><span class="b-txt">$form</span><span class="g-txt">[</span><span class="r-txt">'#validate'</span><span class="g-txt">][] = </span><span class="r-txt">'node_search_validate'</span><span class="g-txt">;<br />
</span><span class="b-txt">?&gt;</span></span> </code> </div>

<h3><a name="validation" id="validation">#validation_arguments</a></h3>

<p>INTERNAL</p>

<h3><a name="value" id="value">#value</a></h3>

<p><strong>Used by</strong>: <a href="#button">button</a>, <a href="#hidden">hidden</a>, <a href="#image_button">image_button</a>, <a href="#submit">submit</a>, <a href="#token">token</a>, <a href="#val">value</a></p>

<p><strong>Description</strong>: Used to set values that cannot be
edited by the user. <strong>Should NOT be confused with <a href="#default_value">#default_value</a></strong>, which is for form
inputs where users can override the default value.</p>

<p><strong>Values</strong>: Mixed (text or numbers)</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/locale/locale.module">locale.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'submit'</span><span class="g-txt">] = array(</span><span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'submit'</span><span class="g-txt">,</span> <span class="r-txt">'#value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Import'</span><span class="g-txt">));<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

<h3><a name="value_callback" id="value_callback">#value_callback</a></h3>

<p><strong>Used by</strong>: All elements.</p>

<p><strong>Description</strong>:
Specifies the name of a custom value function that implements how user input is mapped to an element's #value property.</p>

<p><strong>Values</strong>: A single function name to be called to set the value of this element.</p>

<p>A value function for an element takes $element, $input and $form_state as parameters, and has the form:</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">myelement_value</span><span style="color: #007700">(</span><span style="color: #0000BB">$element</span><span style="color: #007700">, </span><span style="color: #0000BB">$input </span><span style="color: #007700">= </span><span style="color: #0000BB">FALSE</span><span style="color: #007700">, </span><span style="color: #0000BB">$form_state </span><span style="color: #007700">= array()) {<br />&nbsp; if (</span><span style="color: #0000BB">$input </span><span style="color: #007700">=== </span><span style="color: #0000BB">FALSE</span><span style="color: #007700">) {<br />&nbsp;&nbsp;&nbsp; return isset(</span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'#default_value'</span><span style="color: #007700">]) ? </span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'#default_value'</span><span style="color: #007700">] : </span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />&nbsp; }<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/file/file.field.inc">file.field.inc</a>):<code><span class="def-txt"><span class="b-txt"><br />
</span></span></code></p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp; </span><span style="color: #FF8000">// Essentially we use the managed_file type, extended with some enhancements.<br />&nbsp; </span><span style="color: #0000BB">$element_info </span><span style="color: #007700">= </span><span style="color: #0000BB">element_info</span><span style="color: #007700">(</span><span style="color: #DD0000">'managed_file'</span><span style="color: #007700">);<br />&nbsp; </span><span style="color: #0000BB">$element </span><span style="color: #007700">+= array(<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'managed_file'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=&gt; isset(</span><span style="color: #0000BB">$items</span><span style="color: #007700">[</span><span style="color: #0000BB">$delta</span><span style="color: #007700">]) ? </span><span style="color: #0000BB">$items</span><span style="color: #007700">[</span><span style="color: #0000BB">$delta</span><span style="color: #007700">] : </span><span style="color: #0000BB">$defaults</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#upload_location' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">file_field_widget_uri</span><span style="color: #007700">(</span><span style="color: #0000BB">$field</span><span style="color: #007700">, </span><span style="color: #0000BB">$instance</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#upload_validators' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">file_field_widget_upload_validators</span><span style="color: #007700">(</span><span style="color: #0000BB">$field</span><span style="color: #007700">, </span><span style="color: #0000BB">$instance</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#value_callback' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'file_field_widget_value'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#process' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">array_merge</span><span style="color: #007700">(</span><span style="color: #0000BB">$element_info</span><span style="color: #007700">[</span><span style="color: #DD0000">'#process'</span><span style="color: #007700">], array(</span><span style="color: #DD0000">'file_field_widget_process'</span><span style="color: #007700">)),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #FF8000">// Allows this field to return an array instead of a single value.<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#extended' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">,<br />&nbsp; );<br />...<br />function </span><span style="color: #0000BB">file_field_widget_value</span><span style="color: #007700">(</span><span style="color: #0000BB">$element</span><span style="color: #007700">, </span><span style="color: #0000BB">$input </span><span style="color: #007700">= </span><span style="color: #0000BB">FALSE</span><span style="color: #007700">, </span><span style="color: #0000BB">$form_state</span><span style="color: #007700">) {<br />&nbsp; if (</span><span style="color: #0000BB">$input</span><span style="color: #007700">) {<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #FF8000">// Checkboxes lose their value when empty.<br />&nbsp;&nbsp;&nbsp; // If the display field is present make sure its unchecked value is saved.<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #0000BB">$field </span><span style="color: #007700">= </span><span style="color: #0000BB">field_widget_field</span><span style="color: #007700">(</span><span style="color: #0000BB">$element</span><span style="color: #007700">, </span><span style="color: #0000BB">$form_state</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp; if (empty(</span><span style="color: #0000BB">$input</span><span style="color: #007700">[</span><span style="color: #DD0000">'display'</span><span style="color: #007700">])) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000BB">$input</span><span style="color: #007700">[</span><span style="color: #DD0000">'display'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$field</span><span style="color: #007700">[</span><span style="color: #DD0000">'settings'</span><span style="color: #007700">][</span><span style="color: #DD0000">'display_field'</span><span style="color: #007700">] ? </span><span style="color: #0000BB">0 </span><span style="color: #007700">: </span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp; }<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="weightval" id="weightval">#weight</a></h3>

<p><strong>Used by</strong>: All elements.</p>

<p><strong>Description</strong>:
Used to sort the list of form elements
before being output; lower numbers appear before higher numbers.</p>

<p><strong>Values</strong>: A positive or negative number (integer or decimal).</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/book/book.module">book.module</a>):<code><span class="def-txt"><span class="b-txt"><br />
</span></span></code></p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'parent'</span><span class="g-txt">] = array(<br />
</span> <span class="r-txt">&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'select'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp; '#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Parent'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt; (</span><span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">parent</span> <span class="g-txt">?</span> <span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">parent</span> <span class="g-txt">:</span> <span class="b-txt">arg</span><span class="g-txt">(</span><span class="b-txt">4</span><span class="g-txt">)),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#options'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">book_toc</span><span class="g-txt">(</span><span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">nid</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#weight'</span> <span class="g-txt">=&gt; -</span><span class="b-txt">15</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'The
parent that this page belongs in. Note that pages whose parent is
&amp;lt;top-level&amp;gt; are regarded as independent, top-level books.'</span><span class="g-txt">),<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

</body></html>