How to set form type as 'hierarchical_select' programatically? I am using the following code to create a form in Drupal 6. This code displays a drop down filter with which I can select the terms, and apply the filters using the GET method.

function sample_create_form () {
  $vid=2;
  $options = taxonomy_form($vid, $value = 0, $help = NULL, $name = 'sample');
  $form['#method'] = 'get';

  $form['option'] = array(
    '#type' =&gt; 'select',
    '#title' =&gt; t('Terms for the Website'),
    '#options' =&gt; $options,
    '#description' =&gt; t('Website category'),
  );

  $form['submit'] = array(
   '#type' =&gt; 'submit', 
   '#value' =&gt; t('Submit'),
  );

  return $form; 
}


I want to display the form as a Hierarchical Select type. I tried to use 'hierarchical_select' instead of 'select' in the above code but it didn't work. 

Is there a way by which we can get the hierarchical select form? 

I am using Drupal 6 and I have hierarchical select module enabled.

Any help highly appreciated.
I think its better to use hierarchical_select for element as it gives a FORM API that is really easy to use. Check the following snippet as reference

$form['hierarchical_select'] = array(
    '#type' =&gt; 'fieldset',
    '#prefix' =&gt; '&lt;div id="hierarchical_select" class="hierarchical_select_wrapper"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
    '#attributes' =&gt; array(
        'class' =&gt; array('hierarchical-select'),
    ),
);
$form['hierarchical_select']['select_subject'] = array(
    '#type' =&gt; 'hierarchical_select',
    '#title' =&gt; t('Select the tag you wish to use.'),
    '#size' =&gt; 1,
    '#config' =&gt; array(
        'module' =&gt; 'hs_taxonomy',
        'params' =&gt; array(
            'vid' =&gt; 13 //The vocab id
        ),
        'save_lineage' =&gt; 1,
        'enforce_deepest' =&gt; 0,
        'entity_count' =&gt; 0,
        'require_entity' =&gt; 0,
        'resizable' =&gt; 1,
        'level_labels' =&gt; array(
            'status' =&gt; 1,
            'labels' =&gt; array(
                0 =&gt; t('Grade'),
                1 =&gt; t('Subject'),
                2 =&gt; t('Main Topic'),
                3 =&gt; t('Sub Topic'),
                4 =&gt; t('Standard'),
                5 =&gt; t('Sub-Standard'),
            ),
        ),
        'dropbox' =&gt; array(
            'status' =&gt; 0,
            'title' =&gt; t('All selections'),
            'limit' =&gt; 0,
            'reset_hs' =&gt; 1,
        ),
        'editability' =&gt; array(
            'status' =&gt; 0,
            'item_types' =&gt; array(),
        ),
        'animation_delay' =&gt; 400,
        'special_items' =&gt; array(),
       'render_flat_select' =&gt; 0,
       'path' =&gt; 'hierarchical_select_json',
    ),
    '#default_value' =&gt; 0,
);


I hope this helps.