Calling all Drupal developers!
Help us get this on the first page of Digg. DIGG NOW!
Help us get this on the first page of Digg. DIGG NOW!
<!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.4 2008/09/20 00:08:52 heyrocker 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=