Hello,
I was trying to develop a new block with a dropdown menu based on categories.
I've created a new block (php code type) with this content:
<?php
//Default Value for Select
$t_description[] = 'List by State';
//Get Taxonomy Terms in Vocab State
$result = db_query("SELECT term_data.description, term_data.tid FROM term_data WHERE term_data.vid=1 ORDER BY description");
//Populate array with descriptions and links. The key of the array will be our URL.
while ($term = db_fetch_object($result)) {
$t_description['http://www.americanpublicradio.com/gov/views/'.$term->description] = $term->description;
}
//Build the select list using Drupal's 'form_select' function.
$category_select = form_select('', 'category', '', $t_description, $description = NULL, 'on Change="top.location.href=document.getElementById(\'edit-category\').options[document.getElementById(\'edit-category\').selectedIndex].value"', $multiple = FALSE, $required = FALSE);
//Give our subsequent form a name we can grab with the Javascript
$form_attributes[description] = 'state_jump';
//Build our form with Drupal's 'form' function.
return form($category_select, $method = 'get', '', $form_attributes);
?>
Now when I try to log into my page I only can see the following error message:
Fatal error: Call to undefined function: form_select() in /home/meloinve/public_html/includes/common.inc(1150) : eval()'d code on line 11