<!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> </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"><?php<br /> $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">=> </span><span style="color: #DD0000">'actions'</span><span style="color: #007700">);<br /> </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 /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'submit'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#value' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Save'</span><span style="color: #007700">),<br /> );<br /> </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 /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'button'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#value' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Delete'</span><span style="color: #007700">),<br /> );<br /> </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 /> </span><span style="color: #DD0000">'#markup' </span><span style="color: #007700">=> </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 /> );<br /></span><span style="color: #0000BB">?></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"><?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'preview'</span><span class="g-txt">] = array(<br />
</span> <span class="r-txt">'#type'</span> <span class="g-txt">=></span>
<span class="r-txt">'button'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#value'</span> <span class="g-txt">=></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 />
'#weight'</span> <span class="g-txt">=></span> <span class="b-txt">19,<br />
</span><span class="g-txt">);<br />
</span> <span class="b-txt">?></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"><?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'copy'</span><span class="g-txt">] = array(<br />
</span> <span class="r-txt">'#type'</span> <span class="g-txt">=></span>
<span class="r-txt">'checkbox'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=> t(</span><span class="r-txt">'Send me a copy.'</span><span class="g-txt">),<br />
);<br />
</span><span class="b-txt">?></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"><?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 /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'checkboxes'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=> </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">?></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 <div> 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"><?php<br /> </span><span style="color: #007700">if (</span><span style="color: #0000BB">$elements</span><span style="color: #007700">) {<br /> </span><span style="color: #FF8000">// Also aid in theming of field widgets by rendering a classified<br /> // container.<br /> </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 /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'container'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#attributes' </span><span style="color: #007700">=> array(<br /> </span><span style="color: #DD0000">'class' </span><span style="color: #007700">=> array(<br /> </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 /> </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 /> </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 /> ),<br /> ),<br /> </span><span style="color: #DD0000">'#weight' </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">'weight'</span><span style="color: #007700">],<br /> );<br /> }<br /></span><span style="color: #0000BB">?></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">=></span> <span class="b-txt">2007</span><span class="g-txt">,</span> <span class="r-txt">'month'</span> <span class="g-txt">=></span> <span class="b-txt">2</span><span class="g-txt">,</span> <span class="r-txt">'day'</span>
<span class="g-txt">=></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"><?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">-></span><span class="b-txt">name</span><span class="g-txt">] = array(<br />
</span><span class="r-txt">'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'date'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></span> <span class="b-txt">check_plain</span><span class="g-txt">(</span><span class="b-txt">$field</span><span class="g-txt">-></span><span class="b-txt">title</span><span class="g-txt">),</span> <span class="r-txt"><br />
'#default_value'</span> <span class="g-txt">=></span> <span class="b-txt">$edit</span><span class="g-txt">[</span><span class="b-txt">$field</span><span class="g-txt">-></span><span class="b-txt">name</span><span class="g-txt">],</span> <span class="r-txt"><br />
'#description'</span> <span class="g-txt">=></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 />
'#required'</span> <span class="g-txt">=></span> <span class="b-txt">$field</span><span class="g-txt">-></span><span class="b-txt">required<br />
</span><span class="g-txt">);<br />
</span><span class="b-txt">?></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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'fieldset'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#weight'</span> <span class="g-txt">=></span> <span class="b-txt">5</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#collapsible'</span> <span class="g-txt">=></span> <span class="b-txt">TRUE</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#collapsed'</span> <span class="g-txt">=></span> <span class="b-txt">FALSE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?php<br />$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'upload'</span><span style="color: #007700">] = array(<br /> </span><span style="color: #DD0000">'#name' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'file'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#title_display' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'invisible'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#size' </span><span style="color: #007700">=> </span><span style="color: #0000BB">22</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#theme_wrappers' </span><span style="color: #007700">=> array(),<br /> </span><span style="color: #DD0000">'#weight' </span><span style="color: #007700">=> -</span><span style="color: #0000BB">10</span><span style="color: #007700">,<br /> );<br /></span><span style="color: #0000BB">?></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"><?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">=></span> <span class="r-txt">'hidden'</span><span class="g-txt">,</span> <span class="r-txt">'#value'</span> <span class="g-txt">=></span> <span class="b-txt">$bid</span><span class="g-txt">);<br />
</span><span class="b-txt">?></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"><?php<br />
</span></span></code> <span class="b-txt"><code>$form[<span class="r-txt">'from'</span>] = <span class="g-txt">array(</span><br />
</code><code><span class="r-txt">'#type'</span> => <span class="r-txt">'item'</span>,<br />
<span class="r-txt">'#title'</span> => t(<span class="r-txt">'From'</span>),<br />
<span class="r-txt">'#markup'</span> => $user->name .<span class="r-txt">' &lt;'</span>. $user->mail .<span class="r-txt">'&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">?></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">
<?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 />
<span class="r-txt">'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'machine_name'</span><span class="g-txt">,</span><br />
<span class="r-txt">'#default_value'</span> <span class="g-txt">=></span> <span class="b-txt">$vocabulary->machine_name</span><span class="g-txt">,</span><br />
<span class="r-txt">'#maxlength'</span> <span class="g-txt">=></span> <span class="b-txt">21</span><span class="g-txt">,</span><br />
<span class="r-txt">'#machine_name'</span> <span class="g-txt">=></span> <span class="g-txt">array(</span><br />
<span class="r-txt">'exists'</span> <span class="g-txt">=></span> <span class="r-txt">'menu_edit_menu_name_exists'</span><span class="g-txt">,</span><br />
<span class="g-txt">),</span><br />
<span class="g-txt">);</span><br />
?><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">
<?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 />
<span class="r-txt">'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'machine_name'</span><span class="g-txt">,</span><br />
<span class="r-txt">'#title'</span> <span class="g-txt">=></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 />
<span class="r-txt">'#default_value'</span> <span class="g-txt">=></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 />
<span class="r-txt">'#maxlength'</span> <span class="g-txt">=></span> <span class="b-txt">MENU_MAX_MENU_NAME_LENGTH_UI</span><span class="g-txt">,</span><br />
<span class="r-txt">'#description'</span> <span class="g-txt">=></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 />
<span class="r-txt">'#machine_name'</span> <span class="g-txt">=></span> <span class="g-txt">array(</span><br />
<span class="r-txt">'exists'</span> <span class="g-txt">=></span> <span class="r-txt">'menu_edit_menu_name_exists'</span><span class="g-txt">,</span><br />
<span class="r-txt">'source'</span> <span class="g-txt">=></span> <span class="g-txt">array(</span><span class="r-txt">'title'</span><span class="g-txt">),</span><br />
<span class="r-txt">'label'</span> <span class="g-txt">=></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 />
<span class="r-txt">'replace_pattern'</span> <span class="g-txt">=></span> <span class="r-txt">'[^a-z0-9-]+'</span><span class="g-txt">,</span><br />
<span class="r-txt">'replace'</span> <span class="g-txt">=></span> <span class="r-txt">'-'</span><span class="g-txt">,</span><br />
<span class="g-txt">),</span><br />
// A menu's machine name cannot be changed.<br />
<span class="r-txt">'#disabled'</span> => !<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 />
?><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"><?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">-></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">-></span><span style="color: #0000BB">uid</span><span style="color: #007700">); <br /></span><span style="color: #0000BB">?></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);"><?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 /> </span><span style="color: rgb(221, 0, 0);">'#title' </span><span style="color: rgb(0, 119, 0);">=> </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 /> </span><span style="color: rgb(221, 0, 0);">'#type' </span><span style="color: rgb(0, 119, 0);">=> </span><span style="color: rgb(221, 0, 0);">'managed_file'</span><span style="color: rgb(0, 119, 0);">,<br /> </span><span style="color: rgb(221, 0, 0);">'#description' </span><span style="color: rgb(0, 119, 0);">=> </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 /> </span><span style="color: rgb(221, 0, 0);">'#default_value' </span><span style="color: rgb(0, 119, 0);">=> </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 /> </span><span style="color: rgb(221, 0, 0);">'#upload_location' </span><span style="color: rgb(0, 119, 0);">=> </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);">?></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
<p> or <div>), 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"><?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 />
'#markup'</span> <span class="g-txt">=></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">?></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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'password'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#maxlength'</span> <span class="g-txt">=></span> <span class="b-txt">64</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#size'</span> <span class="g-txt">=></span> <span class="b-txt">15</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'password_confirm'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#size'</span> <span class="g-txt">=></span> <span class="b-txt">25</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?php<br /> $active </span><span style="color: #007700">= array(</span><span style="color: #0000BB">0 </span><span style="color: #007700">=> </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">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Active'</span><span style="color: #007700">));<br />...<br /> </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 /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'radios'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Poll status'</span><span style="color: #007700">),<br /> </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=> isset(</span><span style="color: #0000BB">$node</span><span style="color: #007700">-></span><span style="color: #0000BB">active</span><span style="color: #007700">) ? </span><span style="color: #0000BB">$node</span><span style="color: #007700">-></span><span style="color: #0000BB">active </span><span style="color: #007700">: </span><span style="color: #0000BB">1</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$active</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#description' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#access' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$admin</span><span style="color: #007700">,<br /> );<br /></span><span style="color: #0000BB">?></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"><?php<br /> $form</span><span style="color: #007700">[</span><span style="color: #DD0000">'selected'</span><span style="color: #007700">] = array(<br /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'select'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Selected'</span><span style="color: #007700">),<br /> </span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=> array(<br /> </span><span style="color: #0000BB">0 </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'No'</span><span style="color: #007700">),<br /> </span><span style="color: #0000BB">1 </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Yes'</span><span style="color: #007700">),<br /> ),<br /> </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$category</span><span style="color: #007700">[</span><span style="color: #DD0000">'selected'</span><span style="color: #007700">],<br /> </span><span style="color: #DD0000">'#description' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Set this to <em>Yes</em> if you would like this category to be selected by default.'</span><span style="color: #007700">),<br /> );<br /></span><span style="color: #0000BB">?></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"><?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">=></span> <span class="r-txt">'submit'</span><span class="g-txt">,</span> <span class="r-txt">'#value'</span> <span class="g-txt">=></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">?></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"><?php<br /> </span><span style="color: #FF8000">// Build the sortable table header.<br /> </span><span style="color: #0000BB">$header </span><span style="color: #007700">= array(<br /> </span><span style="color: #DD0000">'title' </span><span style="color: #007700">=> array(</span><span style="color: #DD0000">'data' </span><span style="color: #007700">=> </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">=> </span><span style="color: #DD0000">'n.title'</span><span style="color: #007700">),<br /> </span><span style="color: #DD0000">'type' </span><span style="color: #007700">=> array(</span><span style="color: #DD0000">'data' </span><span style="color: #007700">=> </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">=> </span><span style="color: #DD0000">'n.type'</span><span style="color: #007700">),<br /> </span><span style="color: #DD0000">'author' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Author'</span><span style="color: #007700">),<br /> </span><span style="color: #DD0000">'status' </span><span style="color: #007700">=> array(</span><span style="color: #DD0000">'data' </span><span style="color: #007700">=> </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">=> </span><span style="color: #DD0000">'n.status'</span><span style="color: #007700">),<br /> </span><span style="color: #DD0000">'changed' </span><span style="color: #007700">=> array(</span><span style="color: #DD0000">'data' </span><span style="color: #007700">=> </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">=> </span><span style="color: #DD0000">'n.changed'</span><span style="color: #007700">, </span><span style="color: #DD0000">'sort' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'desc'</span><span style="color: #007700">)<br /> );<br />...<br /> </span><span style="color: #FF8000">//Get the node data.<br /> </span><span style="color: #0000BB">$nids </span><span style="color: #007700">= </span><span style="color: #0000BB">$query<br /> </span><span style="color: #007700">-></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 /> -></span><span style="color: #0000BB">limit</span><span style="color: #007700">(</span><span style="color: #0000BB">50</span><span style="color: #007700">)<br /> -></span><span style="color: #0000BB">orderByHeader</span><span style="color: #007700">(</span><span style="color: #0000BB">$header</span><span style="color: #007700">)<br /> -></span><span style="color: #0000BB">execute</span><span style="color: #007700">()<br /> -></span><span style="color: #0000BB">fetchCol</span><span style="color: #007700">();<br /> </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 /> </span><span style="color: #FF8000">//Build the rows.<br /> </span><span style="color: #0000BB">$options </span><span style="color: #007700">= array();<br /> 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 /> </span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #0000BB">$node</span><span style="color: #007700">-></span><span style="color: #0000BB">nid</span><span style="color: #007700">] = array(<br /> </span><span style="color: #DD0000">'title' </span><span style="color: #007700">=> array(<br /> </span><span style="color: #DD0000">'data' </span><span style="color: #007700">=> array(<br /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'link'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$node</span><span style="color: #007700">-></span><span style="color: #0000BB">title</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#href' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'node/' </span><span style="color: #007700">. </span><span style="color: #0000BB">$node</span><span style="color: #007700">-></span><span style="color: #0000BB">nid</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$l_options</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#suffix' </span><span style="color: #007700">=> </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">=> </span><span style="color: #0000BB">node_mark</span><span style="color: #007700">(</span><span style="color: #0000BB">$node</span><span style="color: #007700">-></span><span style="color: #0000BB">nid</span><span style="color: #007700">, </span><span style="color: #0000BB">$node</span><span style="color: #007700">-></span><span style="color: #0000BB">changed</span><span style="color: #007700">))),<br /> ),<br /> ),<br /> </span><span style="color: #DD0000">'type' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'author' </span><span style="color: #007700">=> </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">=> </span><span style="color: #0000BB">$node</span><span style="color: #007700">)),<br /> </span><span style="color: #DD0000">'status' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$node</span><span style="color: #007700">-></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 /> </span><span style="color: #DD0000">'changed' </span><span style="color: #007700">=> </span><span style="color: #0000BB">format_date</span><span style="color: #007700">(</span><span style="color: #0000BB">$node</span><span style="color: #007700">-></span><span style="color: #0000BB">changed</span><span style="color: #007700">, </span><span style="color: #DD0000">'short'</span><span style="color: #007700">),<br /> );<br /> </span><span style="color: #FF8000">//For simplicity, this example omits the code to set the operations column.<br /></span><span style="color: #007700">...<br /> </span><span style="color: #FF8000">//Build the tableselect.<br /> </span><span style="color: #0000BB">$form</span><span style="color: #007700">[</span><span style="color: #DD0000">'nodes'</span><span style="color: #007700">] = array(<br /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'tableselect'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#header' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$header</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$options</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#empty' </span><span style="color: #007700">=> </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 /> );<br /></span><span style="color: #0000BB">?></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"><?php<br /> $form</span><span style="color: #007700">[</span><span style="color: #DD0000">'description'</span><span style="color: #007700">] = array(<br /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'text_format'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Description'</span><span style="color: #007700">),<br /> </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$term</span><span style="color: #007700">-></span><span style="color: #0000BB">description</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#format' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$term</span><span style="color: #007700">-></span><span style="color: #0000BB">format</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#weight' </span><span style="color: #007700">=> </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br /> );<br /></span><span style="color: #0000BB">?></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"><?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">=> </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">=> </span><span style="color: #DD0000">'textarea'</span><span style="color: #007700">,<br /></span>
<span style="color: #DD0000">'#description' </span><span style="color: #007700">=> </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">=> 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">?></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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'textfield'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=></span> <span class="b-txt">$node</span><span class="g-txt">-></span><span class="b-txt">title</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#size'</span> <span class="g-txt">=></span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#maxlength'</span> <span class="g-txt">=></span> <span class="b-txt">128</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#required'</span> <span class="g-txt">=></span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?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> => <span class="r-txt">'value'</span><span class="g-txt">,</span> <span class="r-txt">'#value'</span> <span class="g-txt">=></span> <span class="b-txt">$node->vid</span><span class="g-txt">);<br />
</span><span class="b-txt">?></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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'weight'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=></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 />
'#delta'</span> <span class="g-txt">=></span> <span class="b-txt">10</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#description'</span> <span class="g-txt">=></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">?></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"><?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">?></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"><?php<br /> $form</span><span style="color: #007700">[</span><span style="color: #DD0000">'file_public_path'</span><span style="color: #007700">] = array(<br /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'textfield'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#maxlength' </span><span style="color: #007700">=> </span><span style="color: #0000BB">255</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#description' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#after_build' </span><span style="color: #007700">=> array(</span><span style="color: #DD0000">'system_check_directory'</span><span style="color: #007700">),<br /> );<br /></span><span style="color: #0000BB">?></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. <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 <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>. </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);"><?php<br />
</span><span style="color: rgb(255, 128, 0);">/**<br />
* Implementation of hook_form().<br />
*/<br />
</span><span style="color: rgb(0, 119, 0);">function </span><span style="color: rgb(0, 0, 187);">poll_form</span><span style="color: rgb(0, 119, 0);">(&</span><span style="color: rgb(0, 0, 187);">$node</span><span style="color: rgb(0, 119, 0);">, </span><span style="color: rgb(0, 0, 187);">$form_state</span><span style="color: rgb(0, 119, 0);">) {<br />
...<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);">'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);">] = array(<br />
</span><span style="color: rgb(221, 0, 0);">'#type' </span><span style="color: rgb(0, 119, 0);">=> </span><span style="color: rgb(221, 0, 0);">'submit'</span><span style="color: rgb(0, 119, 0);">,<br />
</span><span style="color: rgb(221, 0, 0);">'#value' </span><span style="color: rgb(0, 119, 0);">=> </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 choices'</span><span style="color: rgb(0, 119, 0);">),<br />
</span><span style="color: rgb(221, 0, 0);">'#description' </span><span style="color: rgb(0, 119, 0);">=> </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 the amount of boxes above isn't enough, click here to add more choices."</span><span style="color: rgb(0, 119, 0);">),<br />
</span><span style="color: rgb(221, 0, 0);">'#weight' </span><span style="color: rgb(0, 119, 0);">=> </span><span style="color: rgb(0, 0, 187);">1</span><span style="color: rgb(0, 119, 0);">,<br />
</span><span style="color: rgb(221, 0, 0);">'#submit' </span><span style="color: rgb(0, 119, 0);">=> array(</span><span style="color: rgb(221, 0, 0);">'poll_more_choices_submit'</span><span style="color: rgb(0, 119, 0);">), </span><span style="color: rgb(255, 128, 0);">// If no javascript action.<br />
</span><span style="color: rgb(221, 0, 0);">'#ajax' </span><span style="color: rgb(0, 119, 0);">=> array(<br />
</span><span style="color: rgb(221, 0, 0);">'callback' </span><span style="color: rgb(0, 119, 0);">=> </span><span style="color: rgb(221, 0, 0);">'poll_choice_js'</span><span style="color: rgb(0, 119, 0);">,<br />
</span><span style="color: rgb(221, 0, 0);">'wrapper' </span><span style="color: rgb(0, 119, 0);">=> </span><span style="color: rgb(221, 0, 0);">'poll-choices'</span><span style="color: rgb(0, 119, 0);">,<br />
</span><span style="color: rgb(221, 0, 0);">'method' </span><span style="color: rgb(0, 119, 0);">=> </span><span style="color: rgb(221, 0, 0);">'replace'</span><span style="color: rgb(0, 119, 0);">,<br />
</span><span style="color: rgb(221, 0, 0);">'effect' </span><span style="color: rgb(0, 119, 0);">=> </span><span style="color: rgb(221, 0, 0);">'fade'</span><span style="color: rgb(0, 119, 0);">,<br />
),<br />
);<br />
...<br />
}<br />
<br />
</span><span style="color: rgb(255, 128, 0);">/**<br />
* Menu callback for AJAX additions. Render the new poll choices.<br />
*/<br />
</span><span style="color: rgb(0, 119, 0);">function
poll_choice_js($form, $form_state) {<br />
return $form['choice_wrapper']['choice'];<br />
}<br />
</span><span style="color: rgb(0, 119, 0);">?></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"><?php<br /> $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 /> </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 /> </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 /> </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 /> </span><span style="color: #DD0000">'#name' </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">'_remove_button'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'submit'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#value' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Remove'</span><span style="color: #007700">), <br /> </span><span style="color: #DD0000">'#validate' </span><span style="color: #007700">=> array(),<br /> </span><span style="color: #DD0000">'#submit' </span><span style="color: #007700">=> array(</span><span style="color: #DD0000">'file_managed_file_submit'</span><span style="color: #007700">),<br /> </span><span style="color: #DD0000">'#limit_validation_errors' </span><span style="color: #007700">=> array(</span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'#parents'</span><span style="color: #007700">]),<br /> </span><span style="color: #DD0000">'#ajax' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$ajax_settings</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#weight' </span><span style="color: #007700">=> -</span><span style="color: #0000BB">5</span><span style="color: #007700">,<br /> );<br /></span><span style="color: #0000BB">?></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. 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">
$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 />
</span><span class="r-txt">'#type' </span><span class="g-txt">=> </span><span class="r-txt">'submit'</span><span class="g-txt">,<br />
</span><span class="r-txt">'#value' </span><span class="g-txt">=> </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Attach'</span><span class="g-txt">),<br />
</span><span class="r-txt">'#name' </span><span class="g-txt">=> </span><span class="r-txt">'attach'</span><span class="g-txt">,<br />
</span><span class="r-txt">'#ajax' </span><span class="g-txt">=> array(<br />
</span><span class="r-txt">'path'
</span><span class="g-txt">=> </span><span class="r-txt">'upload/js'</span><span class="g-txt">,<br />
</span><span class="r-txt">'wrapper'
</span><span class="g-txt">=> </span><span class="r-txt">'attach-wrapper'</span><span class="g-txt">,<br />
</span><span class="r-txt">'progress'
</span><span class="g-txt">=> array(</span><span class="r-txt">'type'
</span><span class="g-txt">=> </span><span class="r-txt">'bar'</span><span class="g-txt">, </span><span class="r-txt">'message' </span><span class="g-txt">=> </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Please wait...'</span><span class="g-txt">)),<br />
),<br />
</span><span class="r-txt">'#submit' </span><span class="g-txt">=> array(</span><span class="r-txt">'node_form_submit_build_node'</span><span class="g-txt">),<br />
);<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/> drupal_get_path('module', 'ajax_example') . '/ajax_example.js' => array(<br/> 'type' => 'file',<br/> ),<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/> 'data' => array('mymodule' => $settings),<br/> '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"><?php<br /></span><span style="color: #007700">if (!</span><span style="color: #0000BB">$user</span><span style="color: #007700">-></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">?></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"><?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">=></span> <span class="g-txt">array(</span><span class="r-txt">'search-form'</span><span class="g-txt">));<br />
</span><span class="b-txt">?></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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'textfield'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#maxlength'</span> <span class="g-txt">=></span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#autocomplete_path'</span> <span class="g-txt">=></span>
<span class="r-txt">'user/autocomplete'</span><span class="g-txt">,</span>
<span class="r-txt"><br />
'#default_value'</span> <span class="g-txt">=></span> <span class="b-txt">$node</span><span class="g-txt">-></span><span class="b-txt">name</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#weight'</span> <span class="g-txt">=> -</span><span class="b-txt">1,<br />
</span><span class="g-txt">);<br />
</span><span class="b-txt">?></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 />
'#input' => TRUE,<br />
'#name' => 'op',<br />
'#button_type' => 'submit',<br />
'#executes_submit_callback' => TRUE,<br />
'#limit_validation_errors' => FALSE,<br />
'#process' => array('ajax_process_form'),<br />
'#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"><?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 /> </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 /> </span><span style="color: #FF8000">// ...<br /><br /> </span><span style="color: #007700">return </span><span style="color: #DD0000">'<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">'>' </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">'</div>'</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'fieldset'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#weight'</span> <span class="g-txt">=></span> <span class="b-txt">3</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#collapsible'</span> <span class="g-txt">=></span> <span class="b-txt">TRUE</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#collapsed'</span> <span class="g-txt">=></span> <span class="b-txt">FALSE</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#tree'</span> <span class="g-txt">=></span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'fieldset'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#weight'</span> <span class="g-txt">=></span> <span class="b-txt">3</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#collapsible'</span> <span class="g-txt">=></span> <span class="b-txt">TRUE</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#collapsed'</span> <span class="g-txt">=></span> <span class="b-txt">FALSE</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#tree'</span> <span class="g-txt">=></span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'description'</span><span class="g-txt">] = array(<br />
</span><span class="r-txt">'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'textarea'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=></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 />
'#cols'</span> <span class="g-txt">=></span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#rows'</span> <span class="g-txt">=></span> <span class="b-txt">5</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?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">=> </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">=> </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">=> </span><span style="color: #DD0000">'fieldset'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=> </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">=> </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#group' </span><span style="color: #007700">=> </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">=> </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">=> </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">=> </span><span style="color: #DD0000">'fieldset'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=> </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">=> </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#group' </span><span style="color: #007700">=> </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">=> </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">=> </span><span style="color: #DD0000">'textfield'</span><span style="color: #007700">,<br /> );<br /></span><span style="color: #0000BB">?></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"><?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'body'</span><span class="g-txt">] = array(<br />
</span> <span class="r-txt">'#type'</span> <span class="g-txt">=></span>
<span class="r-txt">'textarea'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=></span> <span class="b-txt">$node</span><span class="g-txt">-></span><span class="b-txt">body</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#required'</span> <span class="g-txt">=></span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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 =>
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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'weight'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=></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 />
'#delta'</span> <span class="g-txt">=></span> <span class="b-txt">10</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#description'</span> <span class="g-txt">=></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">?></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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'weight'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=></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 />
'#delta'</span> <span class="g-txt">=></span> <span class="b-txt">10</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#description'</span> <span class="g-txt">=></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">?></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"><?php<br />
</span> <span class="g-txt">if (isset(</span><span class="b-txt">$disabled</span><span class="g-txt">[</span><span class="b-txt">$name</span><span class="g-txt">])) {<br />
</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">] = </span><span class="b-txt">TRUE</span><span class="g-txt">;<br />
}<br />
</span><span class="b-txt">?></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">, &</span><span class="b-txt">$form_state, $form</span><span class="g-txt">) {<br /> 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 /> </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 /> }<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"><?php<br /> $form</span><span style="color: #007700">[</span><span style="color: #DD0000">'max_filesize'</span><span style="color: #007700">] = array(<br /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'textfield'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$settings</span><span style="color: #007700">[</span><span style="color: #DD0000">'max_filesize'</span><span style="color: #007700">],<br /> </span><span style="color: #DD0000">'#description' </span><span style="color: #007700">=> </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 <strong>%limit</strong>).'</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'%limit' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#size' </span><span style="color: #007700">=> </span><span style="color: #0000BB">10</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#element_validate' </span><span style="color: #007700">=> array(</span><span style="color: #DD0000">'_file_generic_settings_max_filesize'</span><span style="color: #007700">),<br /> </span><span style="color: #DD0000">'#weight' </span><span style="color: #007700">=> </span><span style="color: #0000BB">5</span><span style="color: #007700">,<br /> );<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">, &</span><span style="color: #0000BB">$form_state</span><span style="color: #007700">) {<br /> if (!empty(</span><span style="color: #0000BB">$element</span><span style="color: #007700">[</span><span style="color: #DD0000">'#value'</span><span style="color: #007700">]) && !</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 /> </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">=> </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 /> }<br />} <br /></span><span style="color: #0000BB">?></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"><?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'site_403'</span><span class="g-txt">] = array(<br />
</span><span class="r-txt">'#type' </span><span class="g-txt">=> </span><span class="r-txt">'textfield'</span><span class="g-txt">,<br />
</span><span class="r-txt">'#title' </span><span class="g-txt">=> </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Default 403 (access denied) page'</span><span class="g-txt">),<br />
</span><span class="r-txt">'#default_value' </span><span class="g-txt">=> </span><span class="b-txt">variable_get</span><span class="g-txt">(</span><span class="r-txt">'site_403'</span><span class="g-txt">, </span><span class="r-txt">''</span><span class="g-txt">),<br />
</span><span class="r-txt">'#size' </span><span class="g-txt">=> </span><span class="b-txt">40</span><span class="g-txt">,<br />
</span><span class="r-txt">'#description' </span><span class="g-txt">=> </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'This page is displayed when the requested document is denied to the current user. If unsure, specify nothing.'</span><span class="g-txt">),<br />
</span><span class="r-txt">'#field_prefix' </span><span class="g-txt">=> </span><span class="b-txt">url</span><span class="g-txt">(</span><span class="b-txt">NULL</span><span class="g-txt">, </span><span class="b-txt">NULL</span><span class="g-txt">, </span><span class="b-txt">NULL</span><span class="g-txt">, </span><span class="b-txt">TRUE</span><span class="g-txt">) . (</span><span class="b-txt">variable_get</span><span class="g-txt">(</span><span class="r-txt">'clean_url'</span><span class="g-txt">, </span><span class="b-txt">0</span><span class="g-txt">) ? </span><span class="r-txt">'' </span><span class="g-txt">: </span><span class="r-txt">'?q='</span><span class="g-txt">)<br />
);<br />
</span><span class="b-txt">?></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"><?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">] = array(<br />
</span><span class="r-txt">'#type' </span><span class="g-txt">=> </span><span class="r-txt">'textfield'</span><span class="g-txt">,<br />
</span><span class="r-txt">'#title' </span><span class="g-txt">=> </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Default total file size per user'</span><span class="g-txt">),<br />
</span><span class="r-txt">'#default_value' </span><span class="g-txt">=> </span><span class="b-txt">$upload_usersize_default</span><span class="g-txt">,<br />
</span><span class="r-txt">'#size' </span><span class="g-txt">=> </span><span class="b-txt">5</span><span class="g-txt">,<br />
</span><span class="r-txt">'#maxlength' </span><span class="g-txt">=> </span><span class="b-txt">5</span><span class="g-txt">,<br />
</span><span class="r-txt">'#description' </span><span class="g-txt">=> </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'The default maximum size of all files a user can have on the site.'</span><span class="g-txt">),<br />
</span><span class="r-txt">'#field_suffix' </span><span class="g-txt">=> </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">?></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"><?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'email'</span><span class="g-txt">] = array(<br />
</span><span class="r-txt">'#type' </span><span class="g-txt">=> </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">] = array(<br />
</span><span class="r-txt">'#type' </span><span class="g-txt">=> </span><span class="r-txt">'fieldset'</span><span class="g-txt">,<br />
</span><span class="r-txt">'#title' </span><span class="g-txt">=> </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Welcome (new user created by administrator)'</span><span class="g-txt">),<br />
</span><span class="r-txt">'#collapsible' </span><span class="g-txt">=> </span><span class="b-txt">TRUE</span><span class="g-txt">,<br />
</span><span class="r-txt">'#collapsed' </span><span class="g-txt">=> </span><span class="b-txt">(variable_get('user_register', 1) != 0)</span><span class="g-txt">,<br />
</span><span class="r-txt">'#description' </span><span class="g-txt">=> </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Edit the welcome e-mail messages sent to new member accounts created by an administrator.'</span><span class="g-txt">),<br />
</span><span class="r-txt">'#group' </span><span class="g-txt">=> </span><span class="r-txt">'email'</span><span class="g-txt"><br />
);<br />
</span><span class="b-txt">?></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' => 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);"><?php<br />
$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 />
</span><span style="color: rgb(221, 0, 0);">'#type'
</span><span style="color: rgb(0, 119, 0);">=> </span><span style="color: rgb(221, 0, 0);">'item'</span><span style="color: rgb(0, 119, 0);">,<br />
</span><span style="color: rgb(221, 0, 0);">'#title'
</span><span style="color: rgb(0, 119, 0);">=> </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 />
</span><span style="color: rgb(221, 0, 0);">'#markup'
</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);">-></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);">' &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);">-></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);">'&gt;'</span><span style="color: rgb(0, 119, 0);">,<br />
);<br />
</span><span style="color: rgb(0, 0, 187);">?></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"><?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'title'</span><span class="g-txt">] = array(<br />
</span> <span class="r-txt">'#type'</span> <span class="g-txt">=></span>
<span class="r-txt">'textfield'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=></span> <span class="b-txt">$node</span><span class="g-txt">-></span><span class="b-txt">title</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#size'</span> <span class="g-txt">=></span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#maxlength'</span> <span class="g-txt">=></span> <span class="b-txt">128</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#required'</span> <span class="g-txt">=></span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?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">?></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"><?php<br />
</span> <span class="g-txt">return array(</span><span class="r-txt"><br />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'select'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></span> <span class="b-txt">$title</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#default_value'</span> <span class="g-txt">=></span> <span class="b-txt">$value</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#options'</span> <span class="g-txt">=></span> <span class="b-txt">$options</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#description'</span> <span class="g-txt">=></span> <span class="b-txt">$description</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#multiple'</span> <span class="g-txt">=></span> <span class="b-txt">$multiple</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#size'</span> <span class="g-txt">=></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 />
</span><span class="r-txt">'#weight'</span> <span class="g-txt">=> -</span><span class="b-txt">15</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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' => t('Display Value 1'), 'return_value2' => 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"><?php<br /> $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 /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'select'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#options' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=> </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 /> );<br /></span><span style="color: #0000BB">?></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"><?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 />
</span> <span class="r-txt">'#type'</span> <span class="g-txt">=></span>
<span class="r-txt">'radios'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#parents'</span> <span class="g-txt">=> array(</span><span class="r-txt">'status'</span><span class="g-txt">),</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=></span> <span class="b-txt">$status</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#options'</span> <span class="g-txt">=> 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 />
'#weight'</span> <span class="g-txt">=> -</span><span class="b-txt">1</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?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">?></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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'fieldset'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#prefix'</span> <span class="g-txt">=></span> <span class="r-txt">'<div class="poll-form">'</span><span class="g-txt">,</span>
<span class="r-txt"><br />
'#suffix'</span> <span class="g-txt">=></span> <span class="r-txt">'</div>'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#tree'</span> <span class="g-txt">=></span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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 />
$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 />
$element['#value'] = t('This field has been disabled because you do not have sufficient permissions to edit it.');<br />
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"><?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">=> </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">, <br /> </span><span style="color: #DD0000">'#process' </span><span style="color: #007700">=> 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">=> 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">=> array(</span><span style="color: #DD0000">'form_pre_render_conditional_form_element'</span><span style="color: #007700">),<br /> );<br /></span><span style="color: #0000BB">?></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"><?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'title'</span><span class="g-txt">] = array(<br />
</span> <span class="r-txt">'#type'</span> <span class="g-txt">=></span>
<span class="r-txt">'textfield'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=></span> <span class="b-txt">$node</span><span class="g-txt">-></span><span class="b-txt">title</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#size'</span> <span class="g-txt">=></span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#maxlength'</span> <span class="g-txt">=></span> <span class="b-txt">128</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#required'</span> <span class="g-txt">=></span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'morechoices'</span><span class="g-txt">] = array(<br />
</span><span class="r-txt">'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'checkbox'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#return_value'</span> <span class="g-txt">=></span> <span class="b-txt">1</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#default_value'</span> <span class="g-txt">=></span> <span class="b-txt">0</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#description'</span> <span class="g-txt">=></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">?></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"><?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'description'</span><span class="g-txt">] = array(<br />
</span><span class="r-txt">'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'textarea'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=></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 />
'#cols'</span> <span class="g-txt">=></span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#rows'</span> <span class="g-txt">=></span> <span class="b-txt">5</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?php<br />
$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 />
</span> <span class="r-txt">'#type'</span><span class="g-txt">=></span> <span class="r-txt">'textfield'</span><span class="g-txt">,<br />
</span> <span class="r-txt">'#title'</span><span class="g-txt">=></span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Homepage'</span><span class="g-txt">),<br />
</span> <span class="r-txt">'#maxlength'</span><span class="g-txt">=></span> <span class="b-txt">255</span><span class="g-txt">,<br />
</span> <span class="r-txt">'#size'</span><span class="g-txt">=></span> <span class="b-txt">30</span><span class="g-txt">,<br />
</span> <span class="r-txt">'#default_value'</span><span class="g-txt">=></span> <span class="b-txt">$edit</span><span class="g-txt">[</span><span class="r-txt">'homepage'</span><span class="g-txt">],<br /> );<br /></span><span class="b-txt">?></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>: 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>: 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 /> '#type' => 'container',<br /> '#states' => array(<br />
// Hide the settings when the cancel notify checkbox is disabled.<br />
'invisible' => array(<br />
':input[name="email_canceled_toggle"]' => array('checked' => FALSE),<br /> ),<br /> ),<br /> );
</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>: 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->nid) && node_access('delete', $node)) {<br />
$form['actions']['delete'] = array(<br />
'#type' => 'submit',<br />
'#value' => t('Delete'),<br />
'#weight' => 15,<br />
'#submit' => array('node_form_delete_submit'),<br />
);<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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'fieldset'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#prefix'</span> <span class="g-txt">=></span> <span class="r-txt">'<div class="poll-form">'</span><span class="g-txt">,</span>
<span class="r-txt"><br />
'#suffix'</span> <span class="g-txt">=></span> <span class="r-txt">'</div>'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#tree'</span> <span class="g-txt">=></span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?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 /> </span><span style="color: #DD0000">'#theme' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'menu_local_action'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#link' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$item</span><span style="color: #007700">,<br /> );<br /></span><span style="color: #0000BB">?></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"><?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"> => array(</span><span class="r-txt">'form'</span><span class="g-txt">));</span>
<br />
</span><span class="b-txt">?></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"><?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'description'</span><span class="g-txt">] = array(<br />
</span><span class="r-txt">'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'textarea'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=></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 />
'#cols'</span> <span class="g-txt">=></span> <span class="b-txt">60</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#rows'</span> <span class="g-txt">=></span> <span class="b-txt">5</span><span class="g-txt">,<br />
);<br />
</span><span class="b-txt">?></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"><?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 />
<span class="r-txt">'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'weight'</span><span class="g-txt">,</span><br />
<span class="r-txt">'#default_value'</span> <span class="g-txt">=> </span><span class="b-txt">$block</span><span class="g-txt">[</span><span class="r-txt">'weight'</span><span class="g-txt">],</span><br />
<span class="r-txt">'#delta'</span> <span class="g-txt">=> </span><span class="b-txt">$weight_delta</span><span class="g-txt">,</span><br />
<span class="r-txt">'#title_display'</span> <span class="g-txt">=> </span><span class="r-txt">'invisible'</span><span class="g-txt">,</span><br />
<span class="r-txt">'#title'</span> <span class="g-txt">=> </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">=></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">?></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"><?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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'checkboxes'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#default_value'</span> <span class="g-txt">=></span> <span class="b-txt">$status</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#options'</span> <span class="g-txt">=></span> <span class="b-txt">$options</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#tree'</span> <span class="g-txt">=></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"> $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 />
'#type'</span> <span class="g-txt">=></span> <span class="r-txt">'hidden'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#value'</span> <span class="g-txt">=></span>
<span class="b-txt">1</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#suffix'</span> <span class="g-txt">=></span>
<span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'required'</span><span class="g-txt">),<br />
);<br />
}<br />
</span><span class="b-txt">?></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"><?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">=></span> <span class="r-txt">'submit'</span><span class="g-txt">,</span> <span class="r-txt">'#value'</span> <span class="g-txt">=></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">?></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">&$form_state</span><span class="g-txt">) {<br />
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 />
</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 />
}<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"><?php<br />
</span><span class="y-txt">// Node types:<br />
</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 />
</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 />
</span><span class="r-txt">'#type' </span><span class="g-txt">=> </span><span class="r-txt">'checkboxes'</span><span class="g-txt">,<br />
</span><span class="r-txt">'#title' </span><span class="g-txt">=> </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 />
</span><span class="r-txt">'#prefix' </span><span class="g-txt">=> </span><span class="r-txt">'<div
class="criterion">'</span><span class="g-txt">,<br />
</span><span class="r-txt">'#suffix' </span><span class="g-txt">=> </span><span class="r-txt">'</div>'</span><span class="g-txt">,<br />
</span><span class="r-txt">'#options' </span><span class="g-txt">=> </span><span class="b-txt">$types</span><span class="g-txt">,<br />
);<br />
</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 />
</span><span class="r-txt">'#type' </span><span class="g-txt">=> </span><span class="r-txt">'submit'</span><span class="g-txt">,<br />
</span><span class="r-txt">'#value' </span><span class="g-txt">=> </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Advanced search'</span><span class="g-txt">),<br />
</span><span class="r-txt">'#prefix' </span><span class="g-txt">=> </span><span class="r-txt">'<div
class="action">'</span><span class="g-txt">,<br />
</span><span class="r-txt">'#suffix' </span><span class="g-txt">=> </span><span class="r-txt">'</div>'</span><span class="g-txt">,<br />
);<br />
<br />
</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">?></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"><?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">=></span> <span class="r-txt">'submit'</span><span class="g-txt">,</span> <span class="r-txt">'#value'</span> <span class="g-txt">=></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">?></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"><?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 /> if (</span><span style="color: #0000BB">$input </span><span style="color: #007700">=== </span><span style="color: #0000BB">FALSE</span><span style="color: #007700">) {<br /> 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 /> }<br />}<br /></span><span style="color: #0000BB">?></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"><?php<br /> </span><span style="color: #FF8000">// Essentially we use the managed_file type, extended with some enhancements.<br /> </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 /> </span><span style="color: #0000BB">$element </span><span style="color: #007700">+= array(<br /> </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'managed_file'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=> 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 /> </span><span style="color: #DD0000">'#upload_location' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#upload_validators' </span><span style="color: #007700">=> </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 /> </span><span style="color: #DD0000">'#value_callback' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'file_field_widget_value'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'#process' </span><span style="color: #007700">=> </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 /> </span><span style="color: #FF8000">// Allows this field to return an array instead of a single value.<br /> </span><span style="color: #DD0000">'#extended' </span><span style="color: #007700">=> </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">,<br /> );<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 /> if (</span><span style="color: #0000BB">$input</span><span style="color: #007700">) {<br /> </span><span style="color: #FF8000">// Checkboxes lose their value when empty.<br /> // If the display field is present make sure its unchecked value is saved.<br /> </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 /> 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 /> </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 /> }<br /> }<br /></span><span style="color: #0000BB">?></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"><?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"> '#type'</span> <span class="g-txt">=></span> <span class="r-txt">'select'</span><span class="g-txt">,</span> <span class="r-txt"><br />
'#title'</span> <span class="g-txt">=></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 />
'#default_value'</span> <span class="g-txt">=> (</span><span class="b-txt">$node</span><span class="g-txt">-></span><span class="b-txt">parent</span> <span class="g-txt">?</span> <span class="b-txt">$node</span><span class="g-txt">-></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 />
'#options'</span> <span class="g-txt">=></span> <span class="b-txt">book_toc</span><span class="g-txt">(</span><span class="b-txt">$node</span><span class="g-txt">-></span><span class="b-txt">nid</span><span class="g-txt">),</span> <span class="r-txt"><br />
'#weight'</span> <span class="g-txt">=> -</span><span class="b-txt">15</span><span class="g-txt">,<br />
</span><span class="r-txt">'#description'</span> <span class="g-txt">=></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
&lt;top-level&gt; are regarded as independent, top-level books.'</span><span class="g-txt">),<br />
);<br />
</span><span class="b-txt">?></span></span></code> </div>
</body></html>