Hello!
I read about theming forms at http://api.drupal.org/api/file/developer/topics/forms_api.html/6
Now I tried this for myself inside my own module.
But I get strange results. First, the submit button in the fieldset is above the textfield, although I expected it the other way around (cause I first rendered textfield and then the submit button).
Also I get those five <br>'s below the fieldset, although I rendered it in between.
Second, I get an error message (warning: implode() [function.implode]: Bad arguments. in /var/www/medicalgenomics_drupal/includes/form.inc on line 621.)
What am I doing wrong? Can't find a really good example code.
Here my code:
<?php
/* $Id$ */
function blotbase_search_perm() {
return array('access blotbase_search');
}
function _main() {
//$content = drupal_get_form('_query_form');
$content = theme_query_form(_query_form());
return $content;
}
function _query_form() {
$form["fulltext_search"] = array(
'#type' => 'fieldset',
'#title' => t('Search BlotBase'),
);
$form["fulltext_search"]["action"] = array(
'#type' => 'hidden',
'#value' => 'query',
);
$form["fulltext_search"]["query_string"] = array(
'#type' => 'textfield',
'#title' => t('Search for a gene symbol resp. identifier and/or paper title/author'),
'#default_value' => '',
'#size' => 60,
'#maxlength' => 64,