跳转到所选分类的下拉框

<?php
$output = drupal_get_form ( 'Company_dropdown_form' , $form );
return $output ;

function Company_dropdown_form () {
$vid = 1 ;
$formname = "目录" ;

$vocabulary = db_query ( "SELECT td.name, td.tid FROM {term_data} td WHERE td.vid=%d ORDER BY td.name" , $vid );
// Initialise the country array
$options [] = t ( '选择' . $formname.':' );
//Populate array with url / name
while ( $term = db_fetch_object ( $vocabulary )) {
$options [ 'http://www.jfffabc.com/taxonomy/term/' . $term -> tid ] = $term -> name ;
}
//Build dropdown select
//If we try to build OnChange directly it gets mangled, so put in array to confuse the forms api
$form [ 'category' ] = array(
'#type' => 'select' ,
'#name' => $formname ,
'#id' => $formname ,
'#title' => '' ,
'#default_value' => '' ,
'#options' => $options ,
'#description' => '' ,
'#multiple' => $multiple = FALSE ,
'#required' => $required = FALSE ,
'#attributes' => array( 'onChange' => "top.location.href=document.getElementById('$formname').options[document.getElementById('$formname').selectedIndex].value" ),
);
return $form ;
}
?>