see http://api.drupal.org/api/drupal/developer--topics--forms_api.html/6#com...

and please edit the docs in the right spot to clarify things a little.

Comments

jhodgdon’s picture

The comment (which should be removed -- please do not make comments that report issues)...

Anyway, the comment says:

In the "Creating Forms" section above:

I changed :

function test_page() {
return drupal_get_form('test_form');
}

to become

function test_page() {
$form = drupal_get_form('test_form');
echo $form;
}
jhodgdon’s picture

So my thoughts on this:

That function is fine -- assuming that function test_page() is a page callback from hook_menu() -- because Drupal will print the form in the right place.

So the Forms API Quickstart Guide should mention that is its assumption. Currently it doesn't mention this assumption.

jhodgdon’s picture

Status: Active » Fixed

Another comment: Generally you would NEVER echo/print anything directly in a module!

Anyway, I've added a note to the Drupal 6 and Drupal 7 versions of this guide, since obviously it needed a little clarification. They were in the contrib repository, so I committed the changes.
http://drupal.org/cvs?commit=278814
http://drupal.org/cvs?commit=278812

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.