Create a form without creating a page It seems simple enough to create a form in Drupal 7 with the Form API, however, everything I find shows that you have to use hook_menu() to add a page and then generate the form that way.

I would like to create a standalone form, then just display the form using drupal_get_form() and drupal_render() to render the form.

How do I create a custom form without creating it's own page?
It's very simple...add a function to your module:

function MYMODULE_some_form($form, &amp;$form_state) {
  // Build and return your form.
}


Call drupal_get_form() from whatever context makes sense to your use case, and render the result:

$form = drupal_get_form('MYMODULE_some_form');
$rendered_form = drupal_render($form);


Then you can use $rendered_form as the output wherever it makes sense to do so (usually a template file).