Closed (fixed)
Project:
Documentation
Version:
4.7.0-beta6
Component:
Developer Guide
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Mar 2006 at 11:40 UTC
Updated:
23 Mar 2006 at 06:35 UTC
$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
Comment #1
simeThe 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.
Comment #2
simeSigne
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.