Index: topics/forms_api_reference.html
===================================================================
RCS file: /cvs/drupal-contrib/contributions/docs/developer/topics/forms_api_reference.html,v
retrieving revision 1.75
diff -u -p -r1.75 forms_api_reference.html
--- topics/forms_api_reference.html	6 Jan 2008 02:01:04 -0000	1.75
+++ topics/forms_api_reference.html	6 Jan 2008 03:44:34 -0000
@@ -873,7 +873,7 @@ td {
 
   <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="#attributes">#attributes</a>, <a href="#button_type">#button_type</a> (default: submit), <a href="#executes_submit_callback">#submit</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>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">#submit</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">&lt;?php<br />
@@ -885,7 +885,7 @@ td {
 
   <h3><a name="checkbox" id="checkbox"></a>checkbox</h3>
   <p><strong>Description</strong>: Format a checkbox.</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="#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>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">&lt;?php<br />
@@ -971,7 +971,7 @@ td {
   </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="#attributes">#attributes</a>, <a href="#button_type">#button_type</a> (default: 'submit'), <a href="#executes_submit_callback">#submit</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="#type"><strong>#type</strong></a>. <a href="#value"><strong>#value</strong></a>, <a href="#weightval">#weight</a></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">#submit</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="#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>
@@ -1000,7 +1000,7 @@ td {
 
   <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="#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>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">&lt;?php<br />
@@ -1014,7 +1014,7 @@ td {
 
   <h3><a name="radio" id="radio"></a>radio</h3>
   <p><strong>Description</strong>: Format a radio button.</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">#suffix</a>, <a href="#title"><strong>#title</strong></a>, <a href="#type"><strong>#type</strong></a>. <a href="#weightval">#weight</a></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>
 
@@ -1034,7 +1034,7 @@ td {
 
   <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="#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>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">&lt;?php<br />
@@ -1050,7 +1050,7 @@ td {
 
   <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="#attributes">#attributes</a>, <a href="#button_type">#button_type</a> (default: 'submit'), <a href="#executes_submit_callback">#submit</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>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">#submit</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">&lt;?php<br />
@@ -1059,7 +1059,7 @@ td {
 
   <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="#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>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">&lt;?php<br />
@@ -1072,7 +1072,7 @@ td {
 
   <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="#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>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">&lt;?php<br />
@@ -1146,8 +1146,7 @@ td {
     <a href="#checkbox">checkbox</a>,  
     <a href="#image_button">image button</a>, 
     <a href="#password">password</a>, 
-    <a href="#radio">radio</a>,  
-    <a href="#radio">radios</a>,  
+    <a href="#radio">radio</a>,   
     <a href="#select">select</a>,  
     <a href="#submit">submit</a>,
     <a href="#textarea">textarea</a>, 
@@ -1161,8 +1160,9 @@ td {
     <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. 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>
+    <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="ahah_effect"></a>#ahah['effect']</h3>
 
@@ -1178,28 +1178,14 @@ td {
 
   <p><strong>Values</strong>: String. Possible values: 'click', 'blur', 'change'. 
   Note that #ahah['event'] does not need to be explicitly specified. Although it can be manually set, usually the <a href="#element_default_values">default value </a> will be sufficient.</p>
-  <p>For your convenience, the defaults per form element type are repeated here:
-  <ul>
-    <li><strong>button</strong>: #ahah['event'] = 'click'</li>
-    <li><strong>checkbox</strong>: #ahah['event'] = 'change'</li>
-    <li><strong>image_button</strong>: #ahah['event'] = 'click'</li>
-    <li><strong>password</strong>: #ahah['event'] = 'blur'</li>
-    <li><strong>radio</strong>: #ahah['event'] = 'change'</li>
-    <li><strong>radios</strong>: #ahah['event'] = 'change'</li>
-    <li><strong>select</strong>: #ahah['event'] = 'change'</li>
-    <li><strong>submit</strong>: #ahah['event'] = 'click'</li>
-    <li><strong>textarea</strong>: #ahah['event'] = 'blur'</li>
-    <li><strong>textfield</strong>: #ahah['event'] = 'blur'</li>
-  </ul>
-  </p>
-
 
   <h3><a name="ahah_method" id="ahah_method"></a>#ahah['method']</h3>
   <p><strong>Description</strong>: Modify the behavior of the returned HTML from an AHAH request when inserting into the <a href="#ahah_wrapper">#ahah_wrapper</a>. If not set, the returned HTML will replace the contents of the wrapper element, but it's also possible to use any of the available <a href="http://docs.jquery.com/DOM/Manipulation">jQuery operations for DOM manipulation</a>. </p>
   <p><strong>Values</strong>: String. Possible values: 'replace' (default), 'after', 'append', 'before', 'prepend'.</p>
 
   <h3><a name="ahah_path" id="ahah_path"></a>#ahah['path']</h3>
-  <p><strong>Used by</strong>: <a href="#button">button</a>, <a href="#submit">submit</a></p>
+
+
   <p><strong>Description</strong>: If set, this property triggers AHAH behaviors on a form element. This is the Drupal menu path to a callback function which will generate HTML and return the string of HTML to Drupal. The result will be placed in the div specified in <a href="#ahah_wrapper">#ahah['wrapper']</a>. </p>
   <p><strong>Values</strong>: String containing a Drupal menu path.</p>
   <p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/upload/upload.module">upload.module</a>):</p>
@@ -1209,6 +1195,21 @@ td {
   </div>
   <p>#ahah['path'] is set to 'upload/js', which has a menu item defined in the same module. Then the menu hook will call the 'upload_js' function which generates HTML and returns it to original page.</p>
 
+  <h3><a name="ahah_progress" id="ahah_progress"></a>#ahah['progress']</h3>
+  
+  <p><strong>Description</strong>: Choose either a throbber or progress bar that is displayed while awaiting a response from the callback, and add an optional message.</p>
+  
+  <p><strong>Values</strong>: Array. Possible keys: 'type', 'message'.</p>
+  <ul>
+    <li><p><strong>#ahah['progress']['type']</strong> String. Possible values: 'throbber' (default), 'bar'.</p>
+    </li>
+    <li><p><strong>#ahah['progress']['message']</strong> String.  An optional message to the user; should be wrapped with t().</p>
+    </li>
+    <li><p><strong>#ahah['progress']['url']</strong> String. The optional callback path to use to determine how full the progress bar is (as defined in progress.js). Only useable when 'type' is 'progress'. </p>
+    </li>
+  </ul>
+  <p><strong>Usage example</strong>: see <a href="#ahah_path">above useage</a> in upload.module</p>
+
   <h3><a name="ahah_wrapper" id="ahah_wrapper"></a>#ahah['wrapper']</h3>
   <p><strong>Description</strong>: This property defines the HTML id attribute of an element on the page will server as the destination for HTML returned by an AHAH request. Usually, a div element is used as the wrapper, as it provides the most flexibility for placement of elements before, after, or inside of it's HTML tags. This property  is required for using AHAH requests in on a form element.</p>
   <p><strong>Values</strong>: String containg a valid id attribute of an HTML element on the same page.</p>
