(Tips) Drupal API - Forms API Reference

Tips : Drupal API - Forms API Reference

An array of function names which will be called after the form is built. Example: node preview.

Usage example (system.module):

<?php
$form
['files']['file_directory_path'] = array(
  '#type' => 'textfield',
  '#title' => t('File system path'),
  '#default_value' => file_directory_path(),
  '#maxlength' => 255,
  '#description' => t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.'),
);

$form['#after_build'] = array('system_check_directory');

...

function
system_check_directory($form_element) {
  file_check_directory($form_element['#value'], FILE_CREATE_DIRECTORY, $form_element['#parents'][0]);
  return $form_element;
}
?>

[Read more..]

Courtesy : http://api.drupal.org/