diff --git includes/form.inc includes/form.inc
index 3992881..b0f123e 100644
--- includes/form.inc
+++ includes/form.inc
@@ -7,8 +7,8 @@
  * Functions that build an abstract representation of a HTML form.
  *
  * All modules should declare their form builder functions to be in this
- * group and each builder function should reference its validate and submit
- * functions using \@see. Conversely, validate and submit functions should
+ * group and each builder function should reference its validation and submit
+ * handlers using \@see. Conversely, validate and submit handlers should
  * reference the form builder function using \@see. For examples, of this see
  * system_modules_uninstall() or user_pass(), the latter of which has the
  * following in its doxygen documentation:
@@ -189,10 +189,10 @@ function drupal_get_form($form_id) {
 }
 
 /**
- * Build and process a form based on a form id.
+ * Builds and processes a form based on a form id.
  *
  * The form may also be retrieved from the cache if the form was built in a
- * previous page-load. The form is then passed on for processing, validation
+ * previous page-load. The form is then passed on for processing, validation,
  * and submission if there is proper input.
  *
  * @param $form_id
@@ -271,7 +271,8 @@ function drupal_get_form($form_id) {
  *   form submission may be found in drupal_redirect_form().
  *
  * @return
- *   The rendered form or NULL, depending upon the $form_state flags that were set.
+ *   The rendered form or NULL, depending upon the $form_state flags that were
+ *   set.
  *
  * @see drupal_redirect_form()
  */
@@ -361,7 +362,7 @@ function drupal_build_form($form_id, &$form_state) {
 }
 
 /**
- * Retrieve default values for the $form_state array.
+ * Retrieves default values for the $form_state array.
  */
 function form_state_defaults() {
   return array(
@@ -467,7 +468,7 @@ function drupal_rebuild_form($form_id, &$form_state, $old_form = NULL) {
 }
 
 /**
- * Fetch a form from cache.
+ * Fetches a form from the cache.
  */
 function form_get_cache($form_build_id, &$form_state) {
   if ($cached = cache_get('form_' . $form_build_id, 'cache_form')) {
@@ -498,7 +499,7 @@ function form_get_cache($form_build_id, &$form_state) {
 }
 
 /**
- * Store a form in the cache.
+ * Stores a form in the cache.
  */
 function form_set_cache($form_build_id, $form, $form_state) {
   // 6 hours cache life time for forms should be plenty.
@@ -914,9 +915,10 @@ function drupal_process_form($form_id, &$form, &$form_state) {
 }
 
 /**
- * Prepares a structured form array by adding required elements,
- * executing any hook_form_alter functions, and optionally inserting
- * a validation token to prevent tampering.
+ * Prepares a structured form array.
+ *
+ * Adds required elements, executes any hook_form_alter functions, and
+ * optionally inserts a validation token to prevent tampering.
  *
  * @param $form_id
  *   A unique string identifying the form for validation, submission,
@@ -1040,8 +1042,10 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
 
 
 /**
- * Validates user-submitted form data from the $form_state using
- * the validate functions defined in a structured form array.
+ * Validates user-submitted form data.
+ *
+ * Validates the submitted form data using the validation handlers defined in
+ * the structured form array.
  *
  * @param $form_id
  *   A unique string identifying the form for validation, submission,
@@ -1057,10 +1061,12 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
  * @param $form_state
  *   A keyed array containing the current state of the form. The current
  *   user-submitted data is stored in $form_state['values'], though
- *   form validation functions are passed an explicit copy of the
+ *   form validation handlers are passed an explicit copy of the
  *   values for the sake of simplicity. Validation handlers can also
  *   $form_state to pass information on to submit handlers. For example:
- *     $form_state['data_for_submission'] = $data;
+ *   @code
+ *   $form_state['data_for_submission'] = $data;
+ *   @endcode
  *   This technique is useful when validation requires file parsing,
  *   web service requests, or other expensive requests that should
  *   not be repeated in the submission step.
@@ -1193,16 +1199,18 @@ function drupal_redirect_form($form_state) {
 }
 
 /**
- * Performs validation on form elements. First ensures required fields are
- * completed, #maxlength is not exceeded, and selected options were in the
- * list of options given to the user. Then calls user-defined validators.
+ * Performs validation on form elements.
+ *
+ * First ensures required fields are completed, #maxlength is not exceeded, and
+ * selected options were in the list of options given to the user. Then calls
+ * user-defined validation handlers.
  *
  * @param $elements
  *   An associative array containing the structure of the form.
  * @param $form_state
  *   A keyed array containing the current state of the form. The current
  *   user-submitted data is stored in $form_state['values'], though
- *   form validation functions are passed an explicit copy of the
+ *   form validation handlers are passed an explicit copy of the
  *   values for the sake of simplicity. Validation handlers can also
  *   $form_state to pass information on to submit handlers. For example:
  *     $form_state['data_for_submission'] = $data;
@@ -1326,12 +1334,12 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) {
       }
     }
 
-    // Call user-defined form level validators.
+    // Call user-defined form-level validation handlers.
     if (isset($form_id)) {
       form_execute_handlers('validate', $elements, $form_state);
     }
-    // Call any element-specific validators. These must act on the element
-    // #value data.
+    // Call any element-specific validation handlers. These must act on the
+    // element #value data.
     elseif (isset($elements['#element_validate'])) {
       foreach ($elements['#element_validate'] as $function) {
         $function($elements, $form_state, $form_state['complete form']);
@@ -1347,9 +1355,10 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) {
 }
 
 /**
- * A helper function used to execute custom validation and submission
- * handlers for a given form. Button-specific handlers are checked
- * first. If none exist, the function falls back to form-level handlers.
+ * Helper function: Executes validation and submission handlers.
+ *
+ * Button-specific handlers are checked first. If none exist, the function
+ * falls back to form-level handlers.
  *
  * @param $type
  *   The type of handler to execute. 'validate' or 'submit' are the
@@ -1533,14 +1542,14 @@ function form_set_error($name = NULL, $message = '', $limit_validation_errors =
 }
 
 /**
- * Clear all errors against all form elements made by form_set_error().
+ * Clears all errors against all form elements made by form_set_error().
  */
 function form_clear_error() {
   drupal_static_reset('form_set_error');
 }
 
 /**
- * Return an associative array of all errors.
+ * Returns an associative array of all errors.
  */
 function form_get_errors() {
   $form = form_set_error();
@@ -1568,16 +1577,18 @@ function form_get_error($element) {
 }
 
 /**
- * Flag an element as having an error.
+ * Flags a form element as having an error.
  */
 function form_error(&$element, $message = '') {
   form_set_error(implode('][', $element['#parents']), $message);
 }
 
 /**
- * Walk through the structured form array, adding any required properties to
+ * Builds a form's elements.
+ *
+ * Walks through the structured form array, adding any required properties to
  * each element and mapping the incoming input data to the proper elements.
- * Also, execute any #process handlers attached to a specific element.
+ * Also, executes any #process handlers attached to a specific element.
  *
  * This is one of the three primary functions that recursively iterates a form
  * array. This one does it for completing the form building process. The other
@@ -1849,8 +1860,9 @@ function form_builder($form_id, &$element, &$form_state) {
 }
 
 /**
- * Populate the #value and #name properties of input elements so they
- * can be processed and rendered.
+ * Populates the #value and #name properties of input elements.
+ *
+ * This allows the form elements to be processed and rendered.
  */
 function _form_builder_handle_input_element($form_id, &$element, &$form_state) {
   if (!isset($element['#name'])) {
@@ -1989,7 +2001,7 @@ function _form_builder_handle_input_element($form_id, &$element, &$form_state) {
 }
 
 /**
- * Helper function to handle the convoluted logic of button click detection.
+ * Helper function: handles the logic of button click detection.
  *
  * This detects button or non-button controls that trigger a form submission via
  * AJAX or some other scriptable environment. These environments can set the
@@ -2009,7 +2021,7 @@ function _form_element_triggered_scripted_submission($element, &$form_state) {
 }
 
 /**
- * Helper function to handle the convoluted logic of button click detection.
+ * Helper function: handles the logic of button click detection.
  *
  * This detects button controls that trigger a form submission by being clicked
  * and having the click processed by the browser rather than being captured by
@@ -2104,18 +2116,21 @@ function form_state_values_clean(&$form_state) {
 }
 
 /**
- * Helper function to determine the value for an image button form element.
+ * Default value callback for the image button form element.
  *
- * @param $form
+ * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
  * @param $form_state
  *   A keyed array containing the current state of the form.
+ *
  * @return
  *   The data that will appear in the $form_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   for this element, or nothing to use the default.
+ *
+ * @see form_type_ELEMENT_value
  */
 function form_type_image_button_value($form, $input, $form_state) {
   if ($input !== FALSE) {
@@ -2151,16 +2166,19 @@ function form_type_image_button_value($form, $input, $form_state) {
 }
 
 /**
- * Helper function to determine the value for a checkbox form element.
+ * Default value callback for the checkbox form element.
  *
- * @param $form
+ * @param $element
  *   The form element whose value is being populated.
-*  @param $input
+ * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   for this element, or nothing to use the default.
+ *
+ * @see form_type_ELEMENT_value
  */
 function form_type_checkbox_value($element, $input = FALSE) {
   if ($input === FALSE) {
@@ -2191,16 +2209,19 @@ function form_type_checkbox_value($element, $input = FALSE) {
 }
 
 /**
- * Helper function to determine the value for a checkboxes form element.
+ * Default value callback for the checkboxes form element.
  *
  * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   for this element, or nothing to use the default.
+ *
+ * @see form_type_ELEMENT_value
  */
 function form_type_checkboxes_value($element, $input = FALSE) {
   if ($input === FALSE) {
@@ -2266,17 +2287,19 @@ function form_type_tableselect_value($element, $input = FALSE) {
 }
 
 /**
- * Helper function to determine the value for a password_confirm form
- * element.
+ * Default value callback for the password_confirm form element.
  *
  * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   for this element, or nothing to use the default.
+ *
+ * @see form_type_ELEMENT_value
  */
 function form_type_password_confirm_value($element, $input = FALSE) {
   if ($input === FALSE) {
@@ -2286,16 +2309,19 @@ function form_type_password_confirm_value($element, $input = FALSE) {
 }
 
 /**
- * Helper function to determine the value for a select form element.
+ * Default value callback for the select form element.
  *
  * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   for this element, or nothing to use the default.
+ *
+ * @see form_type_ELEMENT_value
  */
 function form_type_select_value($element, $input = FALSE) {
   if ($input !== FALSE) {
@@ -2326,16 +2352,19 @@ function form_type_select_value($element, $input = FALSE) {
 }
 
 /**
- * Helper function to determine the value for a textfield form element.
+ * Default value callback for the textfield form element.
  *
  * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   for this element, or nothing to use the default.
+ *
+ * @see form_type_ELEMENT_value
  */
 function form_type_textfield_value($element, $input = FALSE) {
   if ($input !== FALSE && $input !== NULL) {
@@ -2346,16 +2375,19 @@ function form_type_textfield_value($element, $input = FALSE) {
 }
 
 /**
- * Helper function to determine the value for form's token value.
+ * Default value callback for the token form element.
  *
  * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
- *   for this element. Return nothing to use the default.
+ *   for this element, or nothing to use the default.
+ *
+ * @see form_type_ELEMENT_value
  */
 function form_type_token_value($element, $input = FALSE) {
   if ($input !== FALSE) {
@@ -2364,16 +2396,16 @@ function form_type_token_value($element, $input = FALSE) {
 }
 
 /**
- * Change submitted form values during form validation.
+ * Changes submitted form values during form validation.
  *
  * Use this function to change the submitted value of a form element in a form
- * validation function, so that the changed value persists in $form_state
+ * validation handler, so that the changed value persists in $form_state
  * through to the submission handlers.
  *
- * Note that form validation functions are specified in the '#validate'
+ * Note that form validation handlers are specified in the '#validate'
  * component of the form array (the value of $form['#validate'] is an array of
  * validation function names). If the form does not originate in your module,
- * you can implement hook_form_FORM_ID_alter() to add a validation function
+ * you can implement hook_form_FORM_ID_alter() to add a validation handler
  * to $form['#validate'].
  *
  * @param $element
@@ -2414,7 +2446,7 @@ function form_options_flatten($array) {
 }
 
 /**
- * Helper function for form_options_flatten().
+ * Performs recursive flattening for form_options_flatten().
  *
  * Iterates over arrays which may share common values and produces a flat
  * array that has removed duplicate keys. Also handles cases where objects
@@ -2536,6 +2568,7 @@ function theme_select($variables) {
  *   Mixed: Either an associative array of items to list as choices, or an
  *   object with an 'option' member that is an associative array. This
  *   parameter is only used internally and should not be passed.
+ *
  * @return
  *   An HTML string of options for the select form element.
  */
@@ -2572,6 +2605,8 @@ function form_select_options($element, $choices = NULL) {
 }
 
 /**
+ * Finds matching indexes in a select element.
+ *
  * Traverses a select element's #option array looking for any values
  * that hold the given key. Returns an array of indexes that match.
  *
@@ -2599,6 +2634,7 @@ function form_select_options($element, $choices = NULL) {
  *   The select element to search.
  * @param $key
  *   The key to look for.
+ *
  * @return
  *   An array of indexes that match the given $key. Array will be
  *   empty if no elements were found. FALSE if optgroups were found.
@@ -2707,7 +2743,7 @@ function theme_radios($variables) {
 }
 
 /**
- * Expand a password_confirm field into two text boxes.
+ * Expands a password_confirm field into two text boxes.
  */
 function form_process_password_confirm($element) {
   $element['pass1'] =  array(
@@ -2735,7 +2771,7 @@ function form_process_password_confirm($element) {
 }
 
 /**
- * Validate password_confirm element.
+ * Validates a password_confirm element.
  */
 function password_confirm_validate($element, &$element_state) {
   $pass1 = trim($element['pass1']['#value']);
@@ -2776,7 +2812,7 @@ function theme_date($variables) {
 }
 
 /**
- * Roll out a single date element.
+ * Rolls out a single date element.
  */
 function form_process_date($element) {
   // Default to current date
@@ -2841,7 +2877,7 @@ function date_validate($form) {
 }
 
 /**
- * Helper function for usage with drupal_map_assoc to display month names.
+ * Helper function: displays month names for drupal_map_assoc().
  */
 function map_month($month) {
   $months = &drupal_static(__FUNCTION__, array(
@@ -2862,7 +2898,9 @@ function map_month($month) {
 }
 
 /**
- * If no default value is set for weight select boxes, use 0.
+ * Sets a default weight for weight select boxes.
+ *
+ * If no default value is set, use 0.
  */
 function weight_value(&$form) {
   if (isset($form['#default_value'])) {
@@ -2874,8 +2912,7 @@ function weight_value(&$form) {
 }
 
 /**
- * Roll out a single radios element to a list of radios,
- * using the options array as index.
+ * Converts a radios form element into a list of individual radios.
  */
 function form_process_radios($element) {
   if (count($element['#options']) > 0) {
@@ -2958,7 +2995,7 @@ function theme_checkboxes($variables) {
 }
 
 /**
- * Add form_element theming to an element if title or description is set.
+ * Adds form_element theming to an element if title or description is set.
  *
  * This is used as a pre render function for checkboxes and radios.
  */
@@ -3005,6 +3042,9 @@ function form_process_checkbox($element, $form_state) {
   return $element;
 }
 
+/**
+ * Processes checkboxes elements into individual checkbox elements.
+ */
 function form_process_checkboxes($element) {
   $value = is_array($element['#value']) ? $element['#value'] : array();
   $element['#tree'] = TRUE;
@@ -3066,6 +3106,7 @@ function form_process_actions($element, &$form_state) {
  *   container.
  * @param $form_state
  *   The $form_state array for the form this element belongs to.
+ *
  * @return
  *   The processed element.
  */
@@ -3176,11 +3217,12 @@ function theme_tableselect($variables) {
 }
 
 /**
- * Create the correct amount of checkbox or radio elements to populate the table.
+ * Creates checkbox or radio elements to populate a tableselect table.
  *
  * @param $element
  *   An associative array containing the properties and children of the
  *   tableselect element.
+ *
  * @return
  *   The processed element.
  */
@@ -3375,8 +3417,7 @@ function form_validate_machine_name(&$element, &$form_state) {
 }
 
 /**
- * Adds fieldsets to the specified group or adds group members to this
- * fieldset.
+ * Adds fieldsets to the specified group or group members to the fieldset.
  *
  * @param &$element
  *   An associative array containing the properties and children of the
@@ -3384,6 +3425,7 @@ function form_validate_machine_name(&$element, &$form_state) {
  *   child elements are taken over into $form_state.
  * @param $form_state
  *   The $form_state array for the form this fieldset belongs to.
+ *
  * @return
  *   The processed element.
  */
@@ -3487,6 +3529,7 @@ function form_pre_render_fieldset($element) {
  *   fieldset.
  * @param $form_state
  *   The $form_state array for the form this vertical tab widget belongs to.
+ *
  * @return
  *   The processed element.
  */
@@ -3731,7 +3774,7 @@ function theme_password($variables) {
 }
 
 /**
- * Expand weight elements into selects.
+ * Expands weight elements into selects.
  */
 function form_process_weight($element) {
   for ($n = (-1 * $element['#delta']); $n <= $element['#delta']; $n++) {
@@ -4022,8 +4065,8 @@ function _form_set_class(&$element, $class = array()) {
  * @code
  * // Simple and artificial: load a node of a given type for a given user
  * function my_function_1($uid, $type, &$context) {
- *   // The $context array gathers batch context information about the execution (read),
- *   // as well as 'return values' for the current operation (write)
+ *   // The $context array gathers batch context information about the execution
+ *   // (read), as well as 'return values' for the current operation (write)
  *   // The following keys are provided :
  *   // 'results' (read / write): The array of results gathered so far by
  *   //   the batch processing, for the current operation to append its own.
@@ -4341,6 +4384,7 @@ function _batch_populate_queue(&$batch, $set_id) {
  *
  * @param $batch_set
  *   The batch set.
+ *
  * @return
  *   The queue object.
  */
diff --git modules/system/system.api.php modules/system/system.api.php
index ca184f4..2b1b44d 100644
--- modules/system/system.api.php
+++ modules/system/system.api.php
@@ -638,6 +638,7 @@ function hook_cron_queue_info_alter(&$queues) {
  *
  * @see hook_element_info_alter()
  * @see system_element_info()
+ * @see form_type_ELEMENT_value()
  */
 function hook_element_info() {
   $types['filter_format'] = array(
@@ -4425,3 +4426,42 @@ function hook_filetransfer_info_alter(&$filetransfer_info) {
 /**
  * @} End of "addtogroup hooks".
  */
+
+/**
+ * Defines a value callback for a form element.
+ *
+ * If your module uses hook_elements() to define a form element, you can
+ * also define a callback function that will give the element a value during
+ * form submission. This function is not called if a #value element is supplied
+ * by the form constructor, or if a #value_callback element is supplied to
+ * override this default value callback.
+ *
+ * @param $element
+ *   Element array.
+ * @param $input
+ *   The posted value if there was one. FALSE if there is no input to process.
+ * @param $form_state
+ *   A keyed array containing the current state of the form.
+ *
+ * @return
+ *   The value for your element. You can return nothing to use the default
+ *   value.
+ *
+ * @see hook_element_info().
+ */
+function form_type_ELEMENT_value($element, $input, $form_state) {
+  // This example is from form_type_checkbox_value(), which is the default
+  // value callback for a checkbox form element.
+  if ($input !== FALSE) {
+    if (empty($element['#disabled'])) {
+      // Successful (checked) checkboxes are present with a value
+      // (possibly '0'). Return a numeric zero 0.
+      return isset($input) ? $element['#return_value'] : 0;
+    }
+    else {
+      // Disabled form controls are not submitted by the browser. Ignore any
+      // submitted value and always return default.
+      return $element['#default_value'];
+    }
+  }
+}
