forms_api_reference.html

<!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>
<!-- $Id: forms_api_reference.html,v 1.142 2010/12/11 23:59:38 rfay Exp $ -->

  <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>

<p>This document provides a
programmer's reference to the Drupal Form API. If you're interested in
step-by-step documentation to help you write forms, please see the <a href="http://api.drupal.org/api/file/developer/topics/forms_api.html/7">Form
API QuickStart guide</a>.</p>

<p>Skip to: <a href="#properties">Properties</a> | <a href="#element_default_values">Default Values</a> | <a href="#elements">Elements</a></p>

<h2>Form Controls</h2>

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

<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="#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>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>
    <tr>
      <th scope="row"><a href="#after_build">#after_build</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>
    <tr>
      <th scope="row"><a href="#ajax">#ajax</a></th>
      <td class="x"><strong>X</strong></td>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --><td>-</td>
<!-- password --> <td>-</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>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>

    <tr>
      <th scope="row"><a href="#array_parents">#array_parents</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>


    <tr>
      <th scope="row"><a href="#attached">#attached</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>

    <tr>
      <th scope="row"><a href="#attributes">#attributes</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>-</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>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#autocomplete_path">#autocomplete_path</a></th>
      <td>-</td>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td class="x"><strong>X</strong></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>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#collapsed">#collapsed</a></th>
      <td>-</td>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td class="x"><strong>X</strong></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>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#collapsible">#collapsible</a></th>
      <td>-</td>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td class="x"><strong>X</strong></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>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#cols">#cols</a></th>
      <td>-</td>
<!-- 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>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#default_tab">#default_tab</a></th>
      <td>-</td>
<!-- 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>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td class="x"><strong>X</strong></td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#default_value">#default_value</a></th>
      <td class="x"><strong>X</strong></td>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --><td>-</td>
<!-- password --> <td>-</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>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#delta">#delta</a></th>
      <td>-</td>
<!-- 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>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#description">#description</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>-</td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#disabled">#disabled</a></th>
      <td class="x"><strong>X</strong></td>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td><strong>-</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>-</td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#element_validate">#element_validate</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>
    <tr>
      <th scope="row"><a href="#empty">#empty</a></th>
      <td>-</td>
<!-- 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>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#field_prefix">#field_prefix</a></th>
      <td>-</td>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td class="x"><strong>X</strong></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>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#field_suffix">#field_suffix</a></th>
      <td>-</td>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td class="x"><strong>X</strong></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>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#group">#group</a></th>
      <td>-</td>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td class="x"><strong>X</strong></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>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#header">#header</a></th>
      <td>-</td>
<!-- 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>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#js_select">#js_select</a></th>
      <td>-</td>
<!-- 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>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#maxlength">#maxlength</a></th>
      <td>-</td>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --><td class="x"><strong>X</strong></td>
<!-- password --> <td>-</td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#multiple">#multiple</a></th>
      <td>-</td>
<!-- 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 class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#options">#options</a></th>
      <td>-</td>
<!-- 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 class="x"><strong>X</strong></td>
<!-- select --> <td class="x"><strong>X</strong></td>
<!-- tableselect --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#parents">#parents</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>
    <tr>
      <th scope="row"><a href="#post_render">#post_render</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>
    <tr>
      <th scope="row"><a href="#prefix">#prefix</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>
    <tr>
      <th scope="row"><a href="#pre_render">#pre_render</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- select --> <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 --> </tr>
    <tr>
      <th scope="row"><a href="#process">#process</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- select --> <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 --> </tr>
    <tr>
      <th scope="row"><a href="#required">#required</a></th>
      <td class="x"><strong>X</strong></td>
<!-- checkbox --> <td class="x"><strong>X</strong></td>
<!-- checkboxes --> <td class="x"><strong>X</strong></td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td>-</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>-</td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#resizable">#resizable</a></th>
      <td>-</td>
<!-- 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>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#return_value">#return_value</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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 class="x"><strong>X</strong></td>
<!-- radio --> <td>-</td>
<!-- radios --> <td>-</td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#rows">#rows</a></th>
      <td>-</td>
<!-- 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>
<!-- textarea --> <td>-</td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#size">#size</a></th>
      <td>-</td>
<!-- checkbox --> <td>-</td>
<!-- checkboxes --> <td>-</td>
<!-- date --> <td>-</td>
<!-- fieldset --> <td>-</td>
<!-- file --> <td class="x"><strong>X</strong></td>
<!-- machine_name --> <td>-</td>
<!-- managed_file --><td class="x"><strong>X</strong></td>
<!-- password --> <td class="x"><strong>X</strong></td>
<!-- password_confirm --> <td>-</td>
<!-- radio --> <td>-</td>
<!-- radios --> <td class="x"><strong>X</strong></td>
<!-- select --> <td>-</td>
<!-- tableselect --> <td>-</td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#states">#states</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>
    <tr>
      <th scope="row"><a href="#suffix">#suffix</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>
    <tr>
      <th scope="row"><a href="#text_format">#text_format</a></th>
      <td>-</td>
<!-- 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>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td>-</td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#theme">#theme</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>
    <tr>
      <th scope="row"><a href="#theme_wrappers">#theme_wrappers</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>
    <tr>
      <th scope="row"><a href="#title"><strong>#title</strong></a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>-</td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#title_display">#title_display</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>-</td>
<!-- tableselect --> <td class="x"><strong>X</strong></td>
<!-- textarea --> <td class="x"><strong>X</strong></td>
<!-- textfield --> <td>-</td>
<!-- vertical_tabs --> <td class="x"><strong>X</strong></td>
<!-- weight --> </tr>
    <tr>
      <th scope="row"><a href="#tree">#tree</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </tr>
    <tr>
      <th scope="row"><a href="#weightval">#weight</a></th>
      <td class="x"><strong>X</strong></td>
<!-- 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>
<!-- 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 --> </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="#button">button</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>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#action">#action</a></th>
      <td>-</td>
<!-- button --> <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 --> </tr>
    <tr>
      <th scope="row"><a href="#after_build">#after_build</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#ajax">#ajax</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></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 --> </tr>
    <tr>
      <th scope="row"><a href="#attributes">#attributes</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#button_type">#button_type</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></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 --> </tr>
    <tr>
      <th scope="row"><a href="#default_value">#default_value</a></th>
      <td>-</td>
<!-- button --> <td>-</td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td>-</td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#description">#description</a></th>
      <td>-</td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#disabled">#disabled</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></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 --> </tr>
    <tr>
      <th scope="row"><a href="#element_validate">#element_validate</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td>-</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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#executes_submit_callback">#executes_submit_callback</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></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 --> </tr>
    <tr>
      <th scope="row"><a href="#limit_validation_errors">#limit_validation_errors</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></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 --> </tr>
    <tr>
      <th scope="row"><a href="#markup-attribute">#markup</a></th>
      <td>-</td>
<!-- button --> <td>-</td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td>-</td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td class="x"><strong>X</strong></td>
<!-- markup --> <td class="x"><strong>X</strong></td>
<!-- item --> <td>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#method">#method</a></th>
      <td>-</td>
<!-- button --> <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 --> </tr>
    <tr>
      <th scope="row"><a href="#name">#name</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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 --> </tr>
    <tr>
      <th scope="row"><a href="#parents">#parents</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td>-</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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#post_render">#post_render</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#prefix">#prefix</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#pre_render">#pre_render</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#process">#process</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#return_value">#return_value</a></th>
      <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td>-</td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#src">#src</a></th>
      <td>-</td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td>-</td>
<!-- submit --> <td>-</td>
<!-- form --> <td>-</td>
<!-- hidden --> <td>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#submit_property">#submit</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#suffix">#suffix</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#theme">#theme</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#theme_wrappers">#theme_wrappers</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#title"><strong>#title</strong></a></th>
      <td>-</td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#title_display">#title_display</a></th>
      <td>-</td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#tree">#tree</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#validate">#validate</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <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>-</td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td>-</td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#value">#value</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td>-</td>
<!-- form --> <td class="x"><strong>X</strong></td>
<!-- hidden --> <td class="x"><strong>X</strong></td>
<!-- token --> <td>-</td>
<!-- markup --> <td>-</td>
<!-- item --> <td class="x"><strong>X</strong></td>
<!-- value --> </tr>
    <tr>
      <th scope="row"><a href="#weightval">#weight</a></th>
      <td class="x"><strong>X</strong></td>
<!-- button --> <td class="x"><strong>X</strong></td>
<!-- image_button --> <td class="x"><strong>X</strong></td>
<!-- submit --> <td>-</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>-</td>
<!-- value --> </tr>
  </tbody>
</table>

<h2><a name="element_default_values" id="element_default_values">Default
Values</a></h2>

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

<ul>

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

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

<ul>

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

<p>&nbsp;</p>

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

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

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

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

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

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

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

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

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

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

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

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

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

<p><strong>Description</strong>:
Format a set of checkboxes. #options is an associative array, where the
key is the #return_value of the checkbox and the value is displayed.
The #options array can not 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/file/modules/node/node.module">node.module</a>):</p>

<div class="codeblock">
<p><code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'node_options_'</span><span class="g-txt">.</span> <span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">type</span><span class="g-txt">] = array(<br />
</span></span></code> <code>&nbsp;&nbsp;<span class="def-txt"><span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'checkboxes'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Default
options'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">variable_get</span><span class="g-txt">(</span><span class="r-txt">'node_options_'</span><span class="g-txt">.</span> <span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">type,</span> <span class="g-txt">array(</span><span class="r-txt">'status'</span><span class="g-txt">,</span> <span class="r-txt">'promote'</span><span class="g-txt">)),<br />
</span> &nbsp;&nbsp;<span class="r-txt">'#options'</span> <span class="g-txt">=&gt; array(</span><span class="r-txt"><br />
&nbsp;&nbsp;&nbsp; 'status'</span> <span class="g-txt">=&gt;</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="r-txt"><br />
&nbsp;&nbsp;&nbsp;&nbsp;'moderate'</span> <span class="g-txt">=&gt;</span>
<span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'In moderation queue'</span><span class="g-txt">),</span>
<span class="r-txt"><br />
&nbsp;&nbsp;&nbsp;&nbsp;'promote'</span> <span class="g-txt">=&gt;</span>
<span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Promoted to front page'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="r-txt">'sticky'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Sticky at top of lists'</span><span class="g-txt">),</span><span class="g-txt"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="r-txt">'revision'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Create new revision'</span><span class="g-txt">)</span>,<span class="g-txt"><br />
&nbsp;&nbsp;),</span><span class="g-txt"><br />
</span> &nbsp;&nbsp;<span class="r-txt">'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Users with the
&lt;em&gt;administer nodes&lt;/em&gt; permission will be able to
override these options.'</span><span class="g-txt">),<br />
);<br />
</span> <span class="b-txt">?&gt;</span></span></code></p>
</div>

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

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

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

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

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

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

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

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

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

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

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

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

<p>Note: you will need to include <code>$form['#attributes']
=
array('enctype' =&gt; "multipart/form-data");</code> in your form. See
this handbook page for an example <a href="http://drupal.org/node/111782">http://drupal.org/node/111782.</a></p>

<p>Note:
the #required property is not supported (setting it to true will always
cause a validation error). Instead, you may want to use your own
validation function to do checks on the $_FILES array with #required
set to false. You will also have to add your own required asterisk if
you would like one.</p>

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</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="#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/upload/upload.module">upload.module</a>):</p>

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

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

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

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

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

<p>N/A</p>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<!-- End machine_name_element -->


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

<p><strong>Description</strong>: Provides a complete ajax/progress aware widget for uploading a file and saving it to the {files} 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 {files} 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.
<div class="codeblock"><code><span class="def-txt">
  // Load the file via file.fid.<br />
  <span class="b-txt">$file = file_load</span><span class="g-txt">(</span><span class="b-txt">$form_state</span><span class="g-txt">[</span><span class="r-txt">&#x27;values&#x27;</span><span class="g-txt">][</span><span class="r-txt">&#x27;my_file_field&#x27;</span><span class="g-txt">]);</span><br />
  // Change status to permanent.<br />
  <span class="b-txt">$file</span><span class="g-txt">-&gt;</span><span class="b-txt">status</span> <span class="b-txt">= FILE_STATUS_PERMANENT</span><span class="g-txt">;</span><br />
  // Save.<br />
  <span class="b-txt">file_save</span><span class="g-txt">(</span><span class="b-txt">$file</span><span class="g-txt">);</span><br />
  </span></code></div>
</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/7/source">image_example.pages.inc</a>.):</p>

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

<!-- End managed_file -->

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<p><strong>Properties</strong>: <a href="#access">#access</a>, <a href="#after_build">#after_build</a>, <a href="#ajax">#ajax</a>, <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>,
<a href="#description">#description</a>, <a href="#disabled">#disabled</a>,
<a href="#element_validate">#element_validate</a>, <a href="#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/file/modules/system/system.module">comment.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'posting_settings'</span><span class="g-txt">][</span><span class="r-txt">'comment_preview'</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;</span><span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'radios'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Preview
comment'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">variable_get</span><span class="g-txt">(</span><span class="r-txt">'comment_preview'</span><span class="g-txt">,</span> <span class="b-txt">1</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#options'</span> <span class="g-txt">=&gt; array(</span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Optional'</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 />
</span><span class="b-txt">?&gt;</span></span></code> </div>

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

<p><strong>Description</strong>: Format a
drop-down menu or scrolling
selection box.</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="#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/file/modules/system/system.module">system.module</a>):</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'feed'</span><span class="g-txt">][</span><span class="r-txt">'feed_item_length'</span><span class="g-txt">] = array(<br />
</span> <span class="r-txt">&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'select'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Display
of XML feed items'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">variable_get</span><span class="g-txt">(</span><span class="r-txt">'feed_item_length'</span><span class="g-txt">,</span><span class="r-txt">'teaser'</span><span class="g-txt">),<br />
</span> <span class="r-txt">&nbsp;&nbsp;'#options'</span> <span class="g-txt">=&gt; array(</span><span class="r-txt"><br />
&nbsp;&nbsp;&nbsp; 'title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Titles
only'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;&nbsp; 'teaser'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Titles
plus teaser'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;&nbsp;&nbsp;'fulltext'</span> <span class="g-txt">=&gt;</span>
<span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Full text'</span><span class="g-txt">),<br />
&nbsp;&nbsp;),<br />
</span> <span class="r-txt">&nbsp;&nbsp;'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Global setting for the
length of XML feed items that are output by default.'</span><span class="g-txt">),<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

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

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

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

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

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

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

<p><strong>Description</strong>:
Format a table of radios or checkboxes, where the columns are given by
the #headers property, and the rows are the #options property. The
choice of radios or checkboxes depends on the #multiple property, and
JavaScript-enabled "check all" buttons are added if the #js_select
property is TRUE.</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="#element_validate">#element_validate</a>, <a href="#empty">#empty</a>,
<a href="#header">#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/file/modules/comment/comment.admin.inc">comment.admin.inc</a>):</p>

<div class="codeblock">
<p><code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'comments'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'tableselect'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#header'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">$header</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#options'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">$options</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#empty'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'No
comments available'</span><span class="g-txt">),</span> <span class="r-txt"><br />
);<br />
</span> <span class="b-txt">?&gt;</span></span></code></p>
</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="#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="#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/comment/comment.module">comment.module</a>):</p>

<div class="codeblock">
<p><code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'comment'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'textarea'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Comment'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$default</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#text_format'</span> <span class="g-txt">=&gt;</span> <span class="g-txt">isset(</span><span class="b-txt">$edit</span><span class="g-txt">-&gt;</span><span class="b-txt">format</span><span class="g-txt">) ? </span><span class="b-txt">$edit</span><span class="g-txt">-&gt;</span><span class="b-txt">format</span><span class="g-txt"> : </span><span class="b-txt">FILTER_FORMAT_DEFAULT</span><span class="g-txt">)</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#required'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE<br />
</span></span></code><code><span class="def-txt"><span class="g-txt">);<br />
</span> <span class="b-txt">?&gt;</span></span></code></p>
</div>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<p><strong>Description</strong>:
Format all child fieldsets as vertical
tabs.</p>

<p><strong>Properties</strong>:
<a href="#access">#access</a>, <a href="#after_build">#after_build</a>,
<a href="#default_tab">#default_tab</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>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<p><strong>Usage example</strong>
(<a href="http://api.drupal.org/api/file/modules/system/system.module">system.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">
<p><code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'files'</span><span class="g-txt">][</span><span class="r-txt">'file_directory_path'</span><span class="g-txt">] = array(<br />
</span> <span class="r-txt">&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'textfield'</span><span class="g-txt">,<br />
</span> <span class="r-txt"><code><span class="def-txt"><span class="r-txt">&nbsp;&nbsp;</span></span></code>'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'File system path'</span><span class="g-txt">),<br />
</span> <span class="r-txt"><code><span class="def-txt"><span class="r-txt">&nbsp;&nbsp;</span></span></code>'#default_value'</span>
<span class="g-txt">=&gt;</span> <span class="b-txt">file_directory_path</span><span class="g-txt">(),<br />
</span> <span class="r-txt"><code><span class="def-txt"><span class="r-txt">&nbsp;&nbsp;</span></span></code>'#maxlength'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">255</span><span class="g-txt">,<br />
</span> <span class="r-txt"><code><span class="def-txt"><span class="r-txt">&nbsp;&nbsp;</span></span></code>'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'A
file system path where the files will be stored. This directory has to
exist and be writable by Drupal. If the download method is set to
public this directory has to be relative to Drupal installation
directory, and be accessible over the web. When download method is set
to private this directory should not be accessible over the web.
Changing this location after the site has been in use will cause
problems so only change this setting on an existing site if you know
what you are doing.'</span><span class="g-txt">),<br />
);</span><br />
<span class="b-txt">$form</span><span class="g-txt">[</span><span class="r-txt">'#after_build'</span><span class="g-txt">] = array(<span class="r-txt">'system_check_directory'</span>);</span><br />
</span></code></p>
<p><code><span class="def-txt"><span class="g-txt">...<br />
<br />
function</span> <span class="b-txt">system_check_directory</span><span class="g-txt">(</span><span class="b-txt">$form_element</span><span class="g-txt">,</span> <span class="b-txt">&amp;$form_state</span><span class="g-txt">) {<br />
</span> <span class="b-txt">&nbsp;&nbsp;file_check_directory</span><span class="g-txt">(</span><span class="b-txt">$form_element</span><span class="g-txt">[</span><span class="r-txt">'#value'</span><span class="g-txt">],</span> <span class="b-txt">FILE_CREATE_DIRECTORY</span><span class="g-txt">,</span> <span class="b-txt">$form_element</span><span class="g-txt">[</span><span class="r-txt">'#parents'</span><span class="g-txt">][</span><span class="b-txt">0</span><span class="g-txt">]);<br />
</span> <span class="b-txt">&nbsp;&nbsp;</span><span class="g-txt">return</span>
<span class="b-txt">$form_element</span><span class="g-txt">;<br />
}</span><span class="g-txt"><br />
</span> <span class="b-txt">?&gt;</span></span></code></p>
</div>

<h3><a name="ajax" id="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="#hidden">hidden</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="#textfield">textfield</a> </p>

<p>An array of elements whose values control the behavior of the
element with respect to the Drupal AJAX javascript methods.</p>

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

<ol>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

<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">&lt;?php<br />
</span><span class="y-txt">/**<br />
* Implementation of hook_menu().<br />
*/<br />
</span><span class="g-txt">function </span><span class="b-txt">upload_menu</span><span class="g-txt">() {<br />
&nbsp; </span><span class="b-txt">$items</span><span class="g-txt">[</span><span class="r-txt">'upload/js'</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'page callback' </span><span class="g-txt">=&gt; </span><span class="r-txt">'upload_js'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'access arguments' </span><span class="g-txt">=&gt; array(</span><span class="r-txt">'upload files'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'type' </span><span class="g-txt">=&gt; </span><span class="b-txt">MENU_CALLBACK</span><span class="g-txt">,<br />
&nbsp; );<br />
&nbsp; ...<br />
&nbsp; return </span><span class="b-txt">$items</span><span class="g-txt">;<br />
}<br />
<br />
...<br />
<br />
function </span><span class="b-txt">_upload_form</span><span class="g-txt">(</span><span class="b-txt">$node</span><span class="g-txt">) {<br />
&nbsp; ...<br />
&nbsp;&nbsp;&nbsp; </span><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 />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#type' </span><span class="g-txt">=&gt; </span><span class="r-txt">'submit'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#value' </span><span class="g-txt">=&gt; </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Attach'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#name' </span><span class="g-txt">=&gt; </span><span class="r-txt">'attach'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#ajax' </span><span class="g-txt">=&gt; array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'path'
</span><span class="g-txt">=&gt; </span><span class="r-txt">'upload/js'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'wrapper'
</span><span class="g-txt">=&gt; </span><span class="r-txt">'attach-wrapper'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'progress'
</span><span class="g-txt">=&gt; array(</span><span class="r-txt">'type'
</span><span class="g-txt">=&gt; </span><span class="r-txt">'bar'</span><span class="g-txt">, </span><span class="r-txt">'message' </span><span class="g-txt">=&gt; </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Please wait...'</span><span class="g-txt">)),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#submit' </span><span class="g-txt">=&gt; array(</span><span class="r-txt">'node_form_submit_build_node'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp; );<br />
&nbsp; ...<br />
return </span><span class="b-txt">$form</span><span class="g-txt">;<br />
</span><span class="b-txt">?&gt;</span></span></code></div>

<p>#ajax['path']
is set to 'upload/js', which has a menu item defined in the same
module. Then the menu hook will call the 'upload_js' function which
generates HTML and returns it to original page.</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 'progress'. </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 'progress'.
    </li>
</ul>

<p><strong>Usage example</strong>:
see <a href="#ajax_path">above usage</a>
in upload.module</p>

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

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

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

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


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

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

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

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

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

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

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

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

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

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

<p>See <a href="http://api.drupal.org/api/function/drupal_process_attached/7">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/7">AJAX Example</a>):</p>

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

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

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

<h3><a name="attributes" id="attributes">#attributes</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="#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="#textfield">textfield</a>, <a href="#weight">weight</a></p>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<p><strong>Values</strong>: Text giving the array key of the default
tab.</p>

<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="#textfield">textfield</a>, <a href="#token">token</a>, <a href="#weight">weight</a></p>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<p><strong>Used by</strong>: <a href="#button">button</a>, <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#date">date</a>, <a href="#file">file</a>, <a href="#image_button">image_button</a>, <a href="#password">password</a>,
<a href="#password_confirm">password_confirm</a>, <a href="#radio">radio</a>,
<a href="#radios">radios</a>, <a href="#select">select</a>, <a href="#submit">submit</a>, <a href="#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. Note that disabling a form field doesn't necessarily prevent
someone from submitting a value through DOM manipulation. It just tells
the browser not to accept input.</p>

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

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

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

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

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

<p><strong>Description</strong>:
A list of custom validation functions that need to be passed. The
functions must use form_error() or form_set_error() to set 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 the element and the form
state as parameters, and has the form:</p>

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

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

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

<div class="codeblock"> <code> <span class="def-txt"><span class="b-txt">&lt;?php<br />
&nbsp; </span><span class="g-txt">if (</span><span class="b-txt">count</span><span class="g-txt">(</span><span class="b-txt">$formats</span><span class="g-txt">) &gt; </span><span class="b-txt">1</span><span class="g-txt">) {<br />
&nbsp;&nbsp;&nbsp; </span><span class="b-txt">$form </span><span class="g-txt">= array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#type' </span><span class="g-txt">=&gt; </span><span class="r-txt">'fieldset'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#title' </span><span class="g-txt">=&gt; </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Input format'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#collapsible'
</span><span class="g-txt">=&gt; </span><span class="b-txt">TRUE</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#collapsed'
</span><span class="g-txt">=&gt; </span><span class="b-txt">TRUE</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#weight' </span><span class="g-txt">=&gt; </span><span class="b-txt">$weight</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#element_validate'
</span><span class="g-txt">=&gt; array(</span><span class="r-txt">'filter_form_validate'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp; );<br />
&nbsp;&nbsp; ...<br />
</span><span class="b-txt">?&gt;</span> </span></code> </div>

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

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

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

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

<h3><a name="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 button should
submit the form.</p>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<h3><a name="header" id="header">#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>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>

<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="markup-attribute" id="markup-attribute">#markup</a></h3>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<p><strong>Values</strong>: GET or POST. Default is POST.</p>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<p><strong>Values</strong>: An array in the form of <code>array(t('Display
value 1'), t('Display value 2'))</code> or <code>array('return_value1'
=&gt; t('Display Value 1'), 'return_value2' =&gt; t('Display Value 2'))</code>
if specific return values are required.</p>

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

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'posting_settings'</span><span class="g-txt">][</span><span class="r-txt">'comment_preview'</span><span class="g-txt">] = array(<br />
&nbsp;</span> <span class="r-txt">'#type'</span> <span class="g-txt">=&gt;</span>
<span class="r-txt">'radios'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Preview
comment'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">variable_get</span><span class="g-txt">(</span><span class="r-txt">'comment_preview'</span><span class="g-txt">,</span> <span class="b-txt">1</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#options'</span> <span class="g-txt">=&gt; array(</span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Optional'</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 />
</span><span class="b-txt">?&gt;</span></span></code> </div>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<div class="codeblock"> <code><span class="b-txt">$type</span><span class="g-txt">[</span><span class="r-txt">'radios'</span><span class="g-txt">]&nbsp;=&nbsp;array(</span><span class="r-txt">'#input'&nbsp;</span><span class="g-txt">=&gt;&nbsp;</span><span class="b-txt">TRUE</span><span class="g-txt">,&nbsp;</span><span class="r-txt">'#process'&nbsp;</span><span class="g-txt">=&gt;&nbsp;array(</span><span class="r-txt">'expand_radios'</span><span style="color: rgb(0, 119, 0);">));</span></code>
<p>In this example, the function <code>expand_radios</code> is called;
the entire radios element is passed in as the argument. This function
adds new elements of type <code>radio</code> to the existing <code>radios</code>
element array, with keys and values corresponding to the processed
element's <code>#options</code>.</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="#textarea">textarea</a>, <a href="#textfield">textfield</a>, <a href="#weight">weight</a></p>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<p><strong>Description</strong>: Theme
function to call for element. It
must render this element and all of its child elements.</p>

<p><strong>Values</strong>: The name of a
theme function, without the
initial theme_.</p>

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

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

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

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

<p><strong>Description</strong>:
Theme function to call for element,
after the element and children are rendered, but before the <a href="#post_render">#post_render</a> functions are called.</p>

<p><strong>Values</strong>: The name of a theme function, without the
initial theme_.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/system/system.module">system.module</a>
from definition of default properties for a form):</p>

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

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

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

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

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

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

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

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

<p><strong>Used by</strong>: <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#date">date</a>, <a href="#fieldset">fieldset</a>, <a href="#file">file</a>, <a href="#item">item</a>, <a href="#password">password</a>,
<a href="#password_confirm">password_confirm</a>, <a href="#radio">radio</a>,
<a href="#radios">radios</a>, <a href="#select">select</a>, <a href="#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><strong>Values</strong>: String.</p>

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

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

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'blocks'</span><span class="g-txt">][<span class="b-txt">$key</span><span class="g-txt">][</span><span class="r-txt">'weight'</span><span class="g-txt">] = array(</span><br />
&nbsp;<span class="r-txt">'#type'</span> <span class="g-txt">=&gt; <span class="r-txt">'weight'</span><span class="g-txt">,<br />
&nbsp;<span class="r-txt">'#default_value'</span> <span class="g-txt">=&gt; <span class="b-txt">$block</span><span class="g-txt">[</span><span class="r-txt">'weight'</span><span class="g-txt">],</span><br />
&nbsp;<span class="r-txt">'#delta'</span> <span class="g-txt">=&gt; <span class="b-txt">$weight_delta</span><span class="g-txt">,</span><br />
&nbsp;<span class="r-txt">'#title_display'</span> <span class="g-txt">=&gt; <span class="r-txt">'invisible'</span><span class="g-txt">,</span><br />
&nbsp;<span class="r-txt">'#title'</span> <span class="g-txt">=&gt; <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Weight for @block block'</span><span class="g-txt">, array(</span><span class="r-txt">'@block'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$block</span><span class="g-txt">[</span><span class="r-txt">'info'</span><span class="g-txt">])),<br />
);</span><br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

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

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

<p><strong>Description</strong>:
Used to allow collections of form elements. Normally applied to the
"parent" element, as the #tree property cascades to sub-elements. Use
where you previously used ][ in form_ calls. For more information, see <a href="http://drupal.org/node/48643">#tree and #parents</a> in the
handbook.</p>

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

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

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'status'</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp; '#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'checkboxes'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$status</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#options'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">$options</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#tree'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">TRUE</span><span class="g-txt">,<br />
);<br />
</span> <span class="b-txt">$required</span> <span class="g-txt">=
array(</span><span class="r-txt">'block'</span><span class="g-txt">,</span>
<span class="r-txt">'filter'</span><span class="g-txt">,</span> <span class="r-txt">'system'</span><span class="g-txt">,</span> <span class="r-txt">'user'</span><span class="g-txt">,</span> <span class="r-txt">'watchdog'</span><span class="g-txt">);<br />
foreach (</span><span class="b-txt">$required</span> <span class="g-txt">as</span> <span class="b-txt">$require</span><span class="g-txt">) {<br />
</span> <span class="b-txt">&nbsp;&nbsp;$form</span><span class="g-txt">[</span><span class="r-txt">'status'</span><span class="g-txt">][</span><span class="b-txt">$require</span><span class="g-txt">] = array(</span><span class="r-txt"><br />
&nbsp;&nbsp;&nbsp; '#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'hidden'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;&nbsp;&nbsp;'#value'</span> <span class="g-txt">=&gt;</span>
<span class="b-txt">1</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp;&nbsp;&nbsp;&nbsp;'#suffix'</span> <span class="g-txt">=&gt;</span>
<span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'required'</span><span class="g-txt">),<br />
&nbsp;&nbsp;);<br />
}<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

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

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

<p><strong>Description</strong>: Used to
determine the type of form
element.</p>

<p><strong>Values</strong>: <a href="#button">button</a>, <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#date">date</a>, <a href="#fieldset">fieldset</a>, <a href="#file">file</a>, <a href="#form">form</a>, <a href="#hidden">hidden</a>,
<a href="#image_button">image_button</a>, <a href="#item">item</a>, <a href="#machine_name">machine_name</a>, <a href="#markup">markup</a>, <a href="#password">password</a>, <a href="#password_confirm">password_confirm</a>, <a href="#radio">radio</a>,
<a href="#radios">radios</a>, <a href="#select">select</a>, <a href="#submit">submit</a>, <a href="#tableselect">tableselect</a>, <a href="#textarea">textarea</a>, <a href="#textfield">textfield</a>, <a href="#token">token</a>, <a href="#val">value</a>, <a href="#vertical_tabs">vertical_tabs</a>, <a href="#weight">weight</a></p>

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

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

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

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

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

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

<div class="codeblock"> <code> <span class="g-txt">function </span><span class="b-txt">test_form_validate</span><span class="g-txt">(</span><span class="b-txt">$form</span><span class="g-txt">, </span><span class="b-txt">&amp;$form_state</span><span class="g-txt">) {<br />
&nbsp;&nbsp;if (</span><span class="b-txt">$form_state['values']</span><span class="g-txt">[</span><span class="r-txt">'name'</span><span class="g-txt">] == </span><span class="r-txt">''</span><span class="g-txt">) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="b-txt">form_set_error</span><span class="g-txt">(</span><span class="r-txt">'name'</span><span class="g-txt">, </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'You must select a name for this group of settings.'</span><span class="g-txt">));<br />
&nbsp;&nbsp;}<br />
}</span> </code> </div>

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

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

<div class="codeblock"> <code> <span class="def-txt"><span class="b-txt">&lt;?php<br />
&nbsp;&nbsp;&nbsp; </span><span class="y-txt">// Node types:<br />
&nbsp;&nbsp;&nbsp; </span><span class="b-txt">$types </span><span class="g-txt">= </span><span class="b-txt">array_map</span><span class="g-txt">(</span><span class="r-txt">'check_plain'</span><span class="g-txt">, </span><span class="b-txt">node_get_types</span><span class="g-txt">(</span><span class="r-txt">'names'</span><span class="g-txt">));<br />
&nbsp;&nbsp;&nbsp; </span><span class="b-txt">$form</span><span class="g-txt">[</span><span class="r-txt">'advanced'</span><span class="g-txt">][</span><span class="r-txt">'type'</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#type' </span><span class="g-txt">=&gt; </span><span class="r-txt">'checkboxes'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#title' </span><span class="g-txt">=&gt; </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Only of the type(s)'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#prefix' </span><span class="g-txt">=&gt; </span><span class="r-txt">'&lt;div
class="criterion"&gt;'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#suffix' </span><span class="g-txt">=&gt; </span><span class="r-txt">'&lt;/div&gt;'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#options' </span><span class="g-txt">=&gt; </span><span class="b-txt">$types</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp; );<br />
&nbsp;&nbsp;&nbsp; </span><span class="b-txt">$form</span><span class="g-txt">[</span><span class="r-txt">'advanced'</span><span class="g-txt">][</span><span class="r-txt">'submit'</span><span class="g-txt">] = array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#type' </span><span class="g-txt">=&gt; </span><span class="r-txt">'submit'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#value' </span><span class="g-txt">=&gt; </span><span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Advanced search'</span><span class="g-txt">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#prefix' </span><span class="g-txt">=&gt; </span><span class="r-txt">'&lt;div
class="action"&gt;'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span class="r-txt">'#suffix' </span><span class="g-txt">=&gt; </span><span class="r-txt">'&lt;/div&gt;'</span><span class="g-txt">,<br />
&nbsp;&nbsp;&nbsp; );<br />
<br />
&nbsp;&nbsp;&nbsp; </span><span class="b-txt">$form</span><span class="g-txt">[</span><span class="r-txt">'#validate'</span><span class="g-txt">][] = </span><span class="r-txt">'node_search_validate'</span><span class="g-txt">;<br />
</span><span class="b-txt">?&gt;</span></span> </code> </div>

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

<p>INTERNAL</p>

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

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

<p><strong>Description</strong>: Used to set values that cannot be
edited by the user. <strong>Should NOT be confused with <a href="#default_value">#default_value</a></strong>, which is for form
inputs where users can override the default value.</p>

<p><strong>Values</strong>: Mixed (text or numbers)</p>

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

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

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

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

<p><strong>Description</strong>:
Used to sort the list of form elements
before being output; lower numbers appear before higher numbers.</p>

<p><strong>Values</strong>: A
positive or negative number (integer or
decimal)</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/book/book.module">book.module</a>):<code><span class="def-txt"><span class="b-txt"><br />
</span></span></code></p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'parent'</span><span class="g-txt">] = array(<br />
</span> <span class="r-txt">&nbsp;&nbsp;'#type'</span> <span class="g-txt">=&gt;</span> <span class="r-txt">'select'</span><span class="g-txt">,</span> <span class="r-txt"><br />
&nbsp; '#title'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'Parent'</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#default_value'</span> <span class="g-txt">=&gt; (</span><span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">parent</span> <span class="g-txt">?</span> <span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">parent</span> <span class="g-txt">:</span> <span class="b-txt">arg</span><span class="g-txt">(</span><span class="b-txt">4</span><span class="g-txt">)),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#options'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">book_toc</span><span class="g-txt">(</span><span class="b-txt">$node</span><span class="g-txt">-&gt;</span><span class="b-txt">nid</span><span class="g-txt">),</span> <span class="r-txt"><br />
&nbsp;&nbsp;'#weight'</span> <span class="g-txt">=&gt; -</span><span class="b-txt">15</span><span class="g-txt">,<br />
&nbsp;&nbsp;</span><span class="r-txt">'#description'</span> <span class="g-txt">=&gt;</span> <span class="b-txt">t</span><span class="g-txt">(</span><span class="r-txt">'The
parent that this page belongs in. Note that pages whose parent is
&amp;lt;top-level&amp;gt; are regarded as independent, top-level books.'</span><span class="g-txt">),<br />
);<br />
</span><span class="b-txt">?&gt;</span></span></code> </div>

</body></html>