views:

47

answers:

1

I'd like a select box to appear on a form that I'm building, and I know that I can use theme('select', $element); to generate a properly formatted select list. When I check http://api.drupal.org/api/function/theme_select/6, I can see more information about my variable, $element:

$element An associative array containing the properties of the element. Properties used: title, value, options, description, extra, multiple, required

What I do not understand is what my options are for the properties that they list. I think that the properties correspond to actual HTML tag attributes, but it's still confusing. I have learned, for instance, that when I specify '#multiple' in my array, I need to set it to TRUE or FALSE, NOT to "multiple", like you would if you were actually writing HTML. Is the "options" property supposed to be specified as an array, or what? What are my options?

I'd like to know the answer to that question for this problem, of course, but what I'd really like to know is the location of a reference that I can use in the future for these kinds of questions. I would think that api.drupal.org should be it, but it doesn't have all the information I need.

It may be obvious, but I'm pretty new to PHP - that may help you answer my question.

Thanks!

+2  A: 

Those attributes are not HTML attributes, they're Drupal FormAPI attributes. The documentation is here.

To answer your question, yes - #options expects an associative array.

ceejayoz
You're awesome! That's going to be very helpful - thanks!
ldweeks