Hierarchical Select example

  1.  $form['select_some_term'] = array(
  2.     '#type' => 'hierarchical_select',
  3.     '#title' => t('Select the tag you wish to use.'),
  4.     '#config' => array(
  5.       'module' => 'taxonomy',
  6.       'params' => array(
  7.         'vid' => $vid,
  8.       ),
  9.       'save_lineage'    => 0,
  10.       'enforce_deepest' => 0,
  11.       'level_labels' => array(
  12.         'status' => 0,
  13.         'labels' => array(
  14.           0 => t('Main category'),
  15.           1 => t('Subcategory'),
  16.           2 => t('Third level category'),
  17.         ),
  18.       ),
  19.       'dropbox' => array(
  20.         'status' => 0,
  21.         'title'  => t('All selections'),
  22.         'limit'  => 0,
  23.       ),
  24.       'editability' => array(
  25.         'status'           => 0,
  26.         'item_types'       => array(),
  27.         'allow_new_levels' => 0,
  28.         'max_levels'       => 3,
  29.       ),
  30.       'animation_delay'    => 400,
  31.       'exclusive_lineages' => array(),
  32.       'render_flat_select' => 0,
  33.     ),
  34.     '#default_value' => '83',
  35.   );