$form['test'] = array(
    '#type' => 'radios',
    '#title' => t('Test Radios'),
    '#options' => array(
        t('Test 1'),
        t('Test 2'),
        t('Test 3'),
    ),
);

form_render($form);

Outputs

<div class="form-item">
 <label>Test Radios:</label>
 
</div>

Using "drupal_get_form()" functions correctly, but is not mentioned in any of the Form API documentation, while form_render() is mentioned numerous times.

One forum post mentions its correct use: http://drupal.org/node/49778#comment-95502

Comments

sime’s picture

Project: Drupal core » Documentation
Component: forms system » Developer Guide
Category: bug » feature

The description of form_render says that this function is usually called from within a theme.
http://drupaldocs.org/api/head/function/form_render

I believe that form_render requires a different structure of $form to the example you have built and you should indeed use drupal_get_form();

I am tentatively assigning this to Documentation queue.

sime’s picture

Status: Active » Closed (fixed)

Signe

Please see the Forms API quickstart guide, particularly the last par, which tells you which to use.
http://drupaldocs.org/api/head/file/contributions/docs/developer/topics/...

I wondered if this is too hard to find but when I look closer it's accessible via:
Handbooks>Drupal APIs>Form APIs>Quickstart Guide
- which isn't too bad.