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">
<!-- $Id: forms_api_reference.html,v 1.81.2.1 2008/04/15 11:54:37 darthsteven Exp $ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Forms 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;
}
.style1 {color: #0000bb}
.style2 {color: #dd0000}
.style3 {color: #007700}
/*]]>*/
</style>
</head>
<body>
<h1>Forms API Reference</h1>
<p>This document provides a programmer's reference to the Drupal Forms 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">Forms 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">
<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="#password">password</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="#textarea">textarea</a></th>
<th scope="col"><a href="#textfield">textfield</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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<td class="x"><strong>X</strong></td> <!-- weight -->
</tr>
<tr>
<th scope="row"><a href="#ahah">#ahah</a></th>
<td class="x"><strong>X</strong></td> <!-- checkbox -->
<td>-</td> <!-- checkboxes -->
<td>-</td> <!-- date -->
<td>-</td> <!-- fieldset -->
<td>-</td> <!-- file -->
<td class="x"><strong>X</strong></td> <!-- password -->
<td class="x"><strong>X</strong></td> <!-- radio -->
<td>-</td> <!-- radios -->
<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>-</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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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>-</td> <!-- password -->
<td>-</td> <!-- radio -->
<td>-</td> <!-- radios -->
<td>-</td> <!-- select -->
<td>-</td> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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> <!-- password -->
<td>-</td> <!-- radio -->
<td>-</td> <!-- radios -->
<td>-</td> <!-- select -->
<td>-</td> <!-- textarea -->
<td>-</td> <!-- textfield -->
<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> <!-- password -->
<td>-</td> <!-- radio -->
<td>-</td> <!-- radios -->
<td>-</td> <!-- select -->
<td>-</td> <!-- textarea -->
<td>-</td> <!-- textfield -->
<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> <!-- password -->
<td>-</td> <!-- radio -->
<td>-</td> <!-- radios -->
<td>-</td> <!-- select -->
<td class="x"><strong>X</strong></td> <!-- textarea -->
<td>-</td> <!-- textfield -->
<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>-</td> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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> <!-- password -->
<td>-</td> <!-- radio -->
<td>-</td> <!-- radios -->
<td>-</td> <!-- select -->
<td>-</td> <!-- textarea -->
<td>-</td> <!-- textfield -->
<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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<td class="x"><strong>X</strong></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>-</td> <!-- password -->
<td>-</td> <!-- radio -->
<td>-</td> <!-- radios -->
<td>-</td> <!-- select -->
<td>-</td> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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>-</td> <!-- password -->
<td>-</td> <!-- radio -->
<td>-</td> <!-- radios -->
<td>-</td> <!-- select -->
<td>-</td> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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>-</td> <!-- password -->
<td>-</td> <!-- radio -->
<td>-</td> <!-- radios -->
<td>-</td> <!-- select -->
<td>-</td> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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> <!-- password -->
<td>-</td> <!-- radio -->
<td>-</td> <!-- radios -->
<td class="x"><strong>X</strong></td> <!-- select -->
<td>-</td> <!-- textarea -->
<td>-</td> <!-- textfield -->
<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> <!-- password -->
<td>-</td> <!-- radio -->
<td class="x"><strong>X</strong></td> <!-- radios -->
<td class="x"><strong>X</strong></td> <!-- select -->
<td>-</td> <!-- textarea -->
<td>-</td> <!-- textfield -->
<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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<td class="x"><strong>X</strong></td> <!-- weight -->
</tr>
<tr>
<th scope="row"><a href="#return_value">#return_value</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>-</td> <!-- password -->
<td class="x"><strong>X</strong></td> <!-- radio -->
<td class="x"><strong>X</strong></td> <!-- radios -->
<td>-</td> <!-- select -->
<td>-</td> <!-- textarea -->
<td>-</td> <!-- textfield -->
<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> <!-- password -->
<td>-</td> <!-- radio -->
<td>-</td> <!-- radios -->
<td>-</td> <!-- select -->
<td class="x"><strong>X</strong></td> <!-- textarea -->
<td>-</td> <!-- textfield -->
<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>-</td> <!-- password -->
<td>-</td> <!-- radio -->
<td>-</td> <!-- radios -->
<td class="x"><strong>X</strong></td> <!-- select -->
<td>-</td> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<td>-</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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<td class="x"><strong>X</strong></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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<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> <!-- password -->
<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> <!-- textarea -->
<td class="x"><strong>X</strong></td> <!-- textfield -->
<td class="x"><strong>X</strong></td> <!-- weight -->
</tr>
</table>
<h2>Special Elements</h2>
<table border="1">
<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="#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="#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><!-- markup -->
<td class="x"><strong>X</strong></td><!-- item -->
<td>-</td><!-- value -->
</tr>
<tr>
<th scope="row"><a href="#ahah">#ahah</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><!-- markup -->
<td>-</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><!-- 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 class="x"><strong>X</strong></td><!-- hidden -->
<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="#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><!-- 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>-</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><!-- markup -->
<td class="x"><strong>X</strong></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><!-- markup -->
<td class="x"><strong>X</strong></td><!-- item -->
<td class="x"><strong>X</strong></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><!-- markup -->
<td>-</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><!-- 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>-</td><!-- markup -->
<td>-</td><!-- item -->
<td class="x"><strong>X</strong></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><!-- markup -->
<td class="x"><strong>X</strong></td><!-- item -->
<td>-</td><!-- value -->
</tr>
<tr>
<th scope="row"><a href="#redirect">#redirect</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><!-- markup -->
<td>-</td><!-- item -->
<td>-</td><!-- value -->
</tr>
<tr>
<th scope="row"><a href="#required">#required</a></th>
<td>-</td><!-- button -->
<td>-</td><!-- image_button -->
<td>-</td><!-- submit -->
<td>-</td><!-- form -->
<td class="x"><strong>X</strong></td><!-- hidden -->
<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><!-- markup -->
<td>-</td><!-- item -->
<td>-</td><!-- value -->
</tr>
<tr>
<th scope="row"><a href="##submit">#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><!-- 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><!-- 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><!-- 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><!-- 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>-</td><!-- markup -->
<td>-</td><!-- item -->
<td class="x"><strong>X</strong></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><!-- 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>-</td><!-- hidden -->
<td class="x"><strong>X</strong></td><!-- markup -->
<td class="x"><strong>X</strong></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>-</td><!-- hidden -->
<td class="x"><strong>X</strong></td><!-- markup -->
<td class="x"><strong>X</strong></td><!-- item -->
<td>-</td><!-- value -->
</tr>
</table>
<h2><a name="element_default_values" id="element_default_values"></a>Default Values</h2>
<p>Every element automatically has these default values (see _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_elements):</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="#ahah_event">#ahah['event']</a> = 'click' </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="#ahah_event">#ahah['event']</a> = 'change' </li>
</ul>
</li>
<li>
<strong><a href="#checkboxes">checkboxes</a></strong>
<ul>
<li><a href="#tree">#tree</a> = 1</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: none">
<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="#ahah_event">#ahah['event']</a> = 'click' </li>
</ul>
</li>
<li>
<a href="#item"><strong>item</strong></a>
<ul>
<li><a href="#prefix">#prefix</a> = ''</li>
<li><a href="#suffix">#suffix</a> = ''</li>
</ul>
</li>
<li>
<a href="#markup"><strong>markup</strong></a>
<ul>
<li><a href="#prefix">#prefix</a> = ''</li>
<li><a href="#suffix">#suffix</a> = ''</li>
</ul>
</li>
<li><strong><a href="#radio">radio</a></strong></li>
<li style="list-style: none">
<ul>
<li><a href="#ahah_event">#ahah['event']</a> = 'change' </li>
</ul>
</li>
<li><strong><a href="#password">password</a></strong></li>
<li style="list-style: none">
<ul>
<li><a href="#size">#size</a> = 30</li>
<li><a href="#maxlength">#maxlength</a> = 64</li>
<li><a href="#ahah_event">#ahah['event']</a> = 'blur' </li>
</ul>
</li>
<li><strong><a href="#submit">submit</a></strong></li>
<li style="list-style: none">
<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="#ahah_event">#ahah['event']</a> = 'click' </li>
</ul>
</li>
<li>
<strong><a href="#textarea">textarea</a></strong>
<ul>
<li><a href="#cols">#cols</a> = 60</li>
<li><a href="#rows">#rows</a> = 5</li>
<li><a href="#ahah_event">#ahah['event']</a> = 'blur' </li>
</ul>
</li>
<li><strong><a href="#textfield">textfield</a></strong></li>
<li style="list-style: none">
<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="#ahah_event">#ahah['event']</a> = 'blur' </li>
</ul>
</li>
<li>
<strong><a href="#weight">weight</a></strong>
<ul>
<li><a href="#delta">#delta</a> = 10</li>
</ul>
</li>
</ul>
<p> </p>
<h2><a name="elements" id="elements"></a>Elements</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"></a>button</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="#ahah">#ahah</a>, <a href="#attributes">#attributes</a>, <a href="#button_type">#button_type</a> (default: submit), <a href="#executes_submit_callback">#executes_submit_callback</a> (default: FALSE), <a href="#name">#name</a> (default: op), <a href="#prefix">#prefix</a>, <a href="#suffix">#suffix</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/node/node.module">node.module</a>):</p>
<div class="codeblock">
<p><code><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'preview'</font><font color="#007700">] = array(<br />
</font> <font color="#DD0000">'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'button'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#value'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Preview'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#weight'</font> <font color="#007700">=></font> <font color="#0000BB">19,<br /></font><font color="#007700">);<br /></font> <font color="#0000BB">?></font></font></code></p>
</div>
<h3><a name="checkbox" id="checkbox"></a>checkbox</h3>
<p><strong>Description</strong>: Format a checkbox.</p>
<p><strong>Properties</strong>: <a href="#ahah">#ahah</a>, <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>, <a href="#description">#description</a>, <a href="#prefix">#prefix</a>, <a href="#required">#required</a>, <a href="#return_value"><strong>#return_value</strong></a> (default: 1), <a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></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><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'copy'</font><font color="#007700">] = array(<br />
</font> <font color="#DD0000">'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'checkbox'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#title'</font> <font color="#007700">=> t(</font><font color="#DD0000">'Send me a copy.'</font><font color="#007700">),<br />
);<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h3><a name="checkboxes" id="checkboxes"></a>checkboxes</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="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>, <a href="#description">#description</a>, <a href="#options"><strong>#options</strong></a>, <a href="#prefix">#prefix</a>, <a href="#required">#required</a>, <a href="#suffix"></a><a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></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><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'node_options_'</font><font color="#007700">.</font> <font color="#0000BB">$node</font><font color="#007700">-></font><font color="#0000BB">type</font><font color="#007700">] = array(<br /></font></font></code> <code> <font color="#000000"><font color="#DD0000">'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'checkboxes'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#title'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Default options'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#default_value'</font> <font color="#007700">=></font> <font color="#0000BB">variable_get</font><font color="#007700">(</font><font color="#DD0000">'node_options_'</font><font color="#007700">.</font> <font color="#0000BB">$node</font><font color="#007700">-></font><font color="#0000BB">type,</font> <font color="#007700">array(</font><font color="#DD0000">'status'</font><font color="#007700">,</font> <font color="#DD0000">'promote'</font><font color="#007700">)),<br /></font> <font color="#DD0000">'#options'</font> <font color="#007700">=> array(</font><font color="#DD0000"><br />
'status'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Published'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'moderate'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'In moderation queue'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'promote'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Promoted to front page'</font><font color="#007700">),<br />
</font><font color="#DD0000">'sticky'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Sticky at top of lists'</font><font color="#007700">),</font><font color="#007700"><br />
</font><font color="#DD0000">'revision'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Create new revision'</font><font color="#007700">)</font>,<font color="#007700"><br />
),</font><font color="#007700"><br /></font> <font color="#DD0000">'#description'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Users with the <em>administer nodes</em> permission will be able to override these options.'</font><font color="#007700">),<br />
);<br /></font> <font color="#0000BB">?></font></font></code></p>
</div>
<h3><a name="date" id="date"></a>date</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><font color="#007700">array(</font><font color="#DD0000">'year'</font> <font color="#007700">=></font> <font color="#0000BB">2007</font><font color="#007700">,</font> <font color="#DD0000">'month'</font> <font color="#007700">=></font> <font color="#0000BB">2</font><font color="#007700">,</font> <font color="#DD0000">'day'</font> <font color="#007700">=></font> <font color="#0000BB">15</font><font color="#007700">)</font></code></p>
<p><strong>Properties</strong>: <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>, <a href="#description">#description</a>, <a href="#prefix">#prefix</a>, <a href="#required">#required</a>, <a href="#suffix"></a><a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></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><font color="#000000"><font color="#0000BB"><?php<br />
$fields</font><font color="#007700">[</font><font color="#0000BB">$category</font><font color="#007700">][</font><font color="#0000BB">$field</font><font color="#007700">-></font><font color="#0000BB">name</font><font color="#007700">] = array(<br />
</font><font color="#DD0000">'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'date'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#title'</font> <font color="#007700">=></font> <font color="#0000BB">check_plain</font><font color="#007700">(</font><font color="#0000BB">$field</font><font color="#007700">-></font><font color="#0000BB">title</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#default_value'</font> <font color="#007700">=></font> <font color="#0000BB">$edit</font><font color="#007700">[</font><font color="#0000BB">$field</font><font color="#007700">-></font><font color="#0000BB">name</font><font color="#007700">],</font> <font color="#DD0000"><br />
'#description'</font> <font color="#007700">=></font> <font color="#0000BB">_profile_form_explanation</font><font color="#007700">(</font><font color="#0000BB">$field</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#required'</font> <font color="#007700">=></font> <font color="#0000BB">$field</font><font color="#007700">-></font><font color="#0000BB">required<br /></font><font color="#007700">);<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h3><a name="fieldset" id="fieldset"></a>fieldset</h3>
<p><strong>Description</strong>: Format a group of form items.</p>
<p><strong>Properties</strong>: <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="#prefix">#prefix</a>, <a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></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><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'contact'</font><font color="#007700">] = array(</font><font color="#DD0000"><br />
'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'fieldset'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#title'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Contact settings'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#weight'</font> <font color="#007700">=></font> <font color="#0000BB">5</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#collapsible'</font> <font color="#007700">=></font> <font color="#0000BB">TRUE</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#collapsed'</font> <font color="#007700">=></font> <font color="#0000BB">FALSE</font><font color="#007700">,<br />
);<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h3><a name="file" id="file"></a>file</h3>
<p><strong>Description</strong>: Format a file upload field.</p>
<p>Note: you will need to include <code>$form['#attributes'] = array('enctype' => "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="#attributes">#attributes</a>, <a href="#description">#description</a>, <a href="#prefix">#prefix</a>, <a href="#size"><strong>#size</strong></a> (default: 60), <a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></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><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'new'</font><font color="#007700">][</font><font color="#DD0000">'upload'</font><font color="#007700">] = array(<br />
</font> <font color="#DD0000">'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'file'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#title'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Attach new file'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#size'</font> <font color="#007700">=></font> <font color="#0000BB">40,<br /></font><font color="#007700">);<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h3><a name="form" id="form"></a>form</h3>
<p><strong>Description</strong>: A form containing form elements</p>
<p><strong>Properties</strong>: <a href="#action">#action</a> (default: request_uri()), <a href="#attributes">#attributes</a>, <a href="#method">#method</a> (default: 'post'), <a href="#prefix">#prefix</a>, <a href="##submit">#submit</a>, <a href="#suffix">#suffix</a>, <a href="#theme">#theme</a>, <a href="#validate">#validate</a></p>
<p><strong>Usage example</strong>:</p>
<p class="help">N/A</p>
<h3><a name="hidden" id="hidden"></a>hidden</h3>
<p><strong>Description</strong>: Store data in a hidden form field.</p>
<p><strong>Properties</strong>: <a href="#prefix">#prefix</a>, <a href="#suffix">#suffix</a>, <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/block/block.module">block.module</a>):</p>
<div class="codeblock">
<code><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'bid'</font><font color="#007700">] = array(</font><font color="#DD0000">'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'hidden'</font><font color="#007700">,</font> <font color="#DD0000">'#value'</font> <font color="#007700">=></font> <font color="#0000BB">$bid</font><font color="#007700">);<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h3><a name="image_button" id="image_button"></a>image_button</h3>
<p><strong>Description</strong>: Format a form submit button with an image.</p>
<p><strong>Properties</strong>: <a href="#ahah">#ahah</a>, <a href="#attributes">#attributes</a>, <a href="#button_type">#button_type</a> (default: 'submit'), <a href="#executes_submit_callback">#executes_submit_callback</a> (default: TRUE), <a href="#name">#name</a> (default: 'op'), <a href="#prefix">#prefix</a>, <a href="#src">#src</a>, <a href="#suffix">#suffix</a>, <a href="##submit">#submit</a>, <a href="#type"><strong>#type</strong></a>. <a href="#value"><strong>#value</strong></a>, <a href="#weightval">#weight</a></p>
<h3><a name="markup" id="markup"></a>markup</h3>
<p><strong>Description</strong>: Generate generic markup for display inside forms. Note that there is <strong>no need to declare a form element as #type = 'markup'</strong>, as this is the default type.</p>
<p>Note: if you use markup, if your content is not wrapped in tags (generally <p> or <div>), your content will fall outside of collapsed fieldsets.</p>
<p><strong>Properties</strong>: <a href="#attributes">#attributes</a>, <a href="#description"></a> <a href="#prefix">#prefix</a> (default: ''), <a href="#suffix">#suffix</a> (default: ''), <a href="#type">#type</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/contact/contact.module">contact.module</a>):</p>
<div class="codeblock">
<code><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'contact_information'</font><font color="#007700">] = array(</font><font color="#DD0000"><br />
'#value'</font> <font color="#007700">=></font> <font color="#0000BB">variable_get</font><font color="#007700">(</font><font color="#DD0000">'contact_form_information'</font><font color="#007700">,</font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'You can leave us a message using the contact form below.'</font><font color="#007700">)),<br />
);<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h3><a name="item" id="item"></a>item</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="#attributes">#attributes</a>, <a href="#description">#description</a>, <a href="#prefix">#prefix</a> (default: ''), <a href="#required">#required</a>, <a href="#suffix">#suffix</a> (default: ''), <a href="#title"><strong>#title</strong></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/head/file/modules/contact.module">contact.module</a>):</p>
<div class="codeblock">
<p><code><font color="#000000"><font color="#0000BB"><?php<br /></font></font></code> <span class="style1"><code>$form[<span class="style2">'from'</span>] = <span class="style3">array(</span><br />
</code><code><span class="style2">'#type'</span> => <span class="style2">'item'</span>,<br />
<span class="style2">'#title'</span> => t(<span class="style2">'From'</span>),<br />
<span class="style2">'#value'</span> => $user->name .<span class="style2">' &lt;'</span>. $user->mail .<span class="style2">'&gt;'</span>,<br />
<span class="style3">);</span></code></span><code><font color="#000000"><font color="#007700"><br /></font> <font color="#0000BB">?></font></font></code></p>
</div>
<h3><a name="password" id="password"></a>password</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="#ahah">#ahah</a>, <a href="#attributes">#attributes</a>, <a href="#description">#description</a>, <a href="#maxlength"><strong>#maxlength</strong></a> (default: 30), <a href="#prefix">#prefix</a>, <a href="#required">#required</a>, <a href="#size"><strong>#size</strong></a> (default: 64), <a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></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><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'pass'</font><font color="#007700">] = array(</font><font color="#DD0000"><br />
'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'password'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#title'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Password'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#maxlength'</font> <font color="#007700">=></font> <font color="#0000BB">64</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#size'</font> <font color="#007700">=></font> <font color="#0000BB">15</font><font color="#007700">,<br />
);<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h3><a name="radio" id="radio"></a>radio</h3>
<p><strong>Description</strong>: Format a radio button.</p>
<p><strong>Properties</strong>: <a href="#ahah">#ahah</a>, <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>, <a href="#description">#description</a>, <a href="#prefix">#prefix</a>, <a href="#required">#required</a>, <a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></a>, <a href="#type"><strong>#type</strong></a>. <a href="#weightval">#weight</a></p>
<p><strong>Usage example</strong>:</p>
<p class="help">N/A</p>
<h3><a name="radios" id="radios"></a>radios</h3>
<p><strong>Description</strong>: Format a set of radio buttons.</p>
<p><strong>Properties</strong>: <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>, <a href="#description">#description</a>, <a href="#options"><strong>#options</strong></a>, <a href="#prefix">#prefix</a>, <a href="#required">#required</a>, <a href="#suffix"></a><a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></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><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'posting_settings'</font><font color="#007700">][</font><font color="#DD0000">'comment_preview'</font><font color="#007700">] = array(<br />
</font><font color="#DD0000">'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'radios'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#title'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Preview comment'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#default_value'</font> <font color="#007700">=></font> <font color="#0000BB">variable_get</font><font color="#007700">(</font><font color="#DD0000">'comment_preview'</font><font color="#007700">,</font> <font color="#0000BB">1</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#options'</font> <font color="#007700">=> array(</font><font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Optional'</font><font color="#007700">),</font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Required'</font><font color="#007700">)),<br />
);<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h3><a name="select" id="select"></a>select</h3>
<p><strong>Description</strong>: Format a drop-down menu or scrolling selection box.</p>
<p><strong>Properties</strong>: <a href="#ahah">#ahah</a>, <a href="#attributes">#attributes</a>, <a href="#default_value"><strong>#default_value</strong></a>, <a href="#description">#description</a>, <a href="#multiple"><strong>#multiple</strong></a>, <a href="#options"><strong>#options</strong></a>, <a href="#prefix">#prefix</a>, <a href="#required">#required</a>, <a href="#suffix"></a><a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></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><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'feed'</font><font color="#007700">][</font><font color="#DD0000">'feed_item_length'</font><font color="#007700">] = array(<br /></font> <font color="#DD0000"> '#type'</font> <font color="#007700">=></font> <font color="#DD0000">'select'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#title'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Display of XML feed items'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#default_value'</font> <font color="#007700">=></font> <font color="#0000BB">variable_get</font><font color="#007700">(</font><font color="#DD0000">'feed_item_length'</font><font color="#007700">,</font><font color="#DD0000">'teaser'</font><font color="#007700">),<br /></font> <font color="#DD0000"> '#options'</font> <font color="#007700">=> array(</font><font color="#DD0000"><br />
'title'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Titles only'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'teaser'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Titles plus teaser'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'fulltext'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Full text'</font><font color="#007700">),<br />
),<br /></font> <font color="#DD0000"> '#description'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Global setting for the length of XML feed items that are output by default.'</font><font color="#007700">),<br />
);<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h3><a name="submit" id="submit"></a>submit</h3>
<p><strong>Description</strong>: Format a form submit button.</p>
<p><strong>Properties</strong>: <a href="#ahah">#ahah</a>, <a href="#attributes">#attributes</a>, <a href="#button_type">#button_type</a> (default: 'submit'), <a href="#executes_submit_callback">#executes_submit_callback</a> (default: TRUE), <a href="#name">#name</a> (default: 'op'), <a href="#prefix">#prefix</a>, <a href="#suffix">#suffix</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/locale/locale.module">locale.module</a>):</p>
<div class="codeblock">
<code><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'submit'</font><font color="#007700">] = array(</font><font color="#DD0000">'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'submit'</font><font color="#007700">,</font> <font color="#DD0000">'#value'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Import'</font><font color="#007700">));<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h3><a name="textarea" id="textarea"></a>textarea</h3>
<p><strong>Description</strong>: Format a multiple-line text field.</p>
<p><strong>Properties</strong>: <a href="#ahah">#ahah</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="#prefix">#prefix</a>, <a href="#required">#required</a>, <a href="#suffix"></a><a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></a>, <a href="#type"><strong>#type</strong></a>. <a href="#rows"><strong>#rows</strong></a> (default: 5), <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">
<p><code><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'body'</font><font color="#007700">] = array(</font><font color="#DD0000"><br />
'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'textarea'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#title'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Body'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#default_value'</font> <font color="#007700">=></font> <font color="#0000BB">$node</font><font color="#007700">-></font><font color="#0000BB">body</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#required'</font> <font color="#007700">=></font> <font color="#0000BB">TRUE<br /></font></font></code><code><font color="#000000"><font color="#007700">);<br /></font> <font color="#0000BB">?></font></font></code></p>
</div>
<h3><a name="textfield" id="textfield"></a>textfield</h3>
<p><strong>Description</strong>: Format a single-line text field.</p>
<p><strong>Properties</strong>: <a href="#ahah">#ahah</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="#field_prefix">#field_prefix</a>, <a href="#field_suffix">#field_suffix</a>, <a href="#maxlength"><strong>#maxlength</strong></a> (default: 128), <a href="#prefix">#prefix</a>, <a href="#required">#required</a>, <a href="#size"><strong>#size</strong></a> (default: 60), <a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></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><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'title'</font><font color="#007700">] = array(</font><font color="#DD0000"><br />
'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'textfield'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#title'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Subject'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#default_value'</font> <font color="#007700">=></font> <font color="#0000BB">$node</font><font color="#007700">-></font><font color="#0000BB">title</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#size'</font> <font color="#007700">=></font> <font color="#0000BB">60</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#maxlength'</font> <font color="#007700">=></font> <font color="#0000BB">128</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#required'</font> <font color="#007700">=></font> <font color="#0000BB">TRUE</font><font color="#007700">,<br />
);<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h3><a name="val" id="val"></a>value</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><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'vid'</font><font color="#007700">] =</font> <font color="#0000BB">array</font><font color="#007700">(</font><font color="#DD0000">'#type'</font> => <font color="#DD0000">'value'</font><font color="#007700">,</font> <font color="#DD0000">'#value'</font> <font color="#007700">=></font> <font color="#0000BB">$node->vid</font><font color="#007700">);<br /></font><font color="#0000BB">?></font></font></code></p>
<h3><a name="weight" id="weight"></a>weight</h3>
<p><strong>Description</strong>: Format a weight selection menu.</p>
<p><strong>Properties</strong>: <a href="#attributes">#attributes</a>, <a href="#delta"><strong>#delta</strong></a> (default: 10), <a href="#default_value"><strong>#default_value</strong></a>, <a href="#description">#description</a>, <a href="#prefix">#prefix</a>, <a href="#required">#required</a>, <a href="#suffix"></a><a href="#suffix">#suffix</a>, <a href="#title"><strong>#title</strong></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><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'weight'</font><font color="#007700">] = array(</font><font color="#DD0000"><br />
'#type'</font> <font color="#007700">=></font> <font color="#DD0000">'weight'</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#title'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Weight'</font><font color="#007700">),</font> <font color="#DD0000"><br />
'#default_value'</font> <font color="#007700">=></font> <font color="#0000BB">$edit</font><font color="#007700">[</font><font color="#DD0000">'weight'</font><font color="#007700">],</font> <font color="#DD0000"><br />
'#delta'</font> <font color="#007700">=></font> <font color="#0000BB">10</font><font color="#007700">,</font> <font color="#DD0000"><br />
'#description'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'Optional. In the menu, the heavier items will sink and the lighter items will be positioned nearer the top.'</font><font color="#007700">),<br />
);<br /></font><font color="#0000BB">?></font></font></code>
</div>
<h2><a name="properties" id="properties"></a>Properties</h2>
<h3><a name="access" id="access"></a>#access</h3>
<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 of FALSE.</p>
<h3><a name="action" id="action"></a>#action</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><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'#action'</font><font color="#007700">] =</font> <font color="#0000BB">url</font><font color="#007700">(</font><font color="#DD0000">'comment/reply/'</font><font color="#007700">.</font> <font color="#0000BB">$edit</font><font color="#007700">[</font><font color="#DD0000">'nid'</font><font color="#007700">]);<br /></font> <font color="#0000BB">?></font></font></code></p>
<p>Do not forget the # before property names.</p>
</div>
<h3><a name="after_build" id="after_build"></a>#after_build</h3>
<p>An array of function names which will be called after the form is built. Example: node preview.</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">
<p><code><font color="#000000"><font color="#0000BB"><?php<br />
$form</font><font color="#007700">[</font><font color="#DD0000">'files'</font><font color="#007700">][</font><font color="#DD0000">'file_directory_path'</font><font color="#007700">] = array(<br /></font> <font color="#DD0000"> '#type'</font> <font color="#007700">=></font> <font color="#DD0000">'textfield'</font><font color="#007700">,<br /></font> <font color="#DD0000"><code><font color="#000000"><font color="#DD0000"> </font></font></code>'#title'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'File system path'</font><font color="#007700">),<br /></font> <font color="#DD0000"><code><font color="#000000"><font color="#DD0000"> </font></font></code>'#default_value'</font> <font color="#007700">=></font> <font color="#0000BB">file_directory_path</font><font color="#007700">(),<br /></font> <font color="#DD0000"><code><font color="#000000"><font color="#DD0000"> </font></font></code>'#maxlength'</font> <font color="#007700">=></font> <font color="#0000BB">255</font><font color="#007700">,<br /></font> <font color="#DD0000"><code><font color="#000000"><font color="#DD0000"> </font></font></code>'#description'</font> <font color="#007700">=></font> <font color="#0000BB">t</font><font color="#007700">(</font><font color="#DD0000">'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.'</font><font color="#007700">),<br />
);</font><br />
<font color="#0000BB">$form</font><font color="#007700">[</font><font color="#DD0000">'#after_build'</font><font color="#007700">] = array(<font color="#DD0000">'system_check_directory'</font>);</font><br /></font></code></p>
<p><code><font color="#000000"><font color="#007700">...<br />
<br />
function</font> <font color="#0000BB">system_check_directory</font><font color="#007700">(</font><font color="#0000BB">$form</font><font color="#007700">,</font> <font color="#0000BB">$form_element</font><font color="#007700">) {<br /></font> <font color="#0000BB"> file_check_directory</font><font color="#007700">(</font><font color="#0000BB">$form_element</font><font color="#007700">[</font><font color="#DD0000">'#value'</font><font color="#007700">],</font> <font color="#0000BB">FILE_CREATE_DIRECTORY</font><font color="#007700">,</font> <font color="#0000BB">$form_element</font><font color="#007700">[</font><font color="#DD0000">'#parents'</font><font color="#007700">][</font><font color="#0000BB">0</font><font color="#007700">]);<br /></font> <font color="#0000BB"> </font><font color="#007700">return</font> <font color="#0000BB">$form_element</font><font color="#007700">;<br />
}</font><font color="#007700"><br /></font> <font color="#0000BB">?></font></font></code></p>
</div>
<p>Property names without # signs causes havoc.</p>
<h3><a name="ahah" id="ahah"></a>#ahah</h3>
<p><strong>Used by</strong>:
<a href="#button">button</a>,
<a href="#checkbox">checkbox</a>,
<a href="#image_button">image button</a>,
<a href="#password">password</a>,
<a href="#radio">radio</a>,
<a href="#select">select</a>,
<a href="#submit">submit</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 AHAH javascript methods.</p>
<p>The #ahah name refers to <a href="http://en.wikipedia.org/wiki/AHAH">AHAH javascript replacement</a> (Asychronous HTML and HTTP), a relative of AJAX.
AHAH is a form of javascript page replacement that is both easy and straight forward. In a nutshell an AHAH request follows these steps:</p>
<ol>
<li>Drupal builds a form element with a set of #ahah properties. The <code>misc/ahah.js</code> file is included on the page automatically. </li>
<li>ahah.js finds all the form elements on the page that have an <a href="#ahah_path">#ahah['path']</a> set and adds an event handler for the <a href="#ahah_event">#ahah['event']</a> set on that form element.</li>
<li>When the <a href="#ahah_event">#ahah['event']</a> occurs on the element (such as 'click'), the AHAH request is made to the Drupal path of the element's <a href="#ahah_path">#ahah['path']</a>.<br />
</li>
<li>Drupal generates HTML in a second request in the background. While the user waits for the callback to execute a throbber or progress bar is shown as determined by <a href="#ahah_progress">#ahah['progress']</a>. The result is returned to the original page containing the form element.</li>
<li>ahah.js gets the result and inserts the returned HTML into the <a href="#ahah_wrapper">#ahah['wrapper']</a>.
Depending on the <a href="#ahah_method">#ahah['method']</a>, the result may affect the wrapper in different ways. </li>
</ol>
<h3><a name="ahah_effect" id="