Index: form_example/form_example.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/examples/form_example/form_example.module,v
retrieving revision 1.8
diff -u -p -r1.8 form_example.module
--- form_example/form_example.module	14 Oct 2010 19:11:55 -0000	1.8
+++ form_example/form_example.module	1 Nov 2010 15:47:31 -0000
@@ -119,6 +119,15 @@ function form_example_menu() {
     'file' => 'form_example_tutorial.inc',
     'weight' => 9,
   );
+  $items['examples/form_example/tutorial/10'] = array(
+    'title' => '#10',
+    'page callback' => 'form_example_tutorial_10',
+    'access callback' => TRUE,
+    'description' => 'Tutorial 10: A page with multiple forms',
+    'type' => MENU_LOCAL_TASK,
+    'file' => 'form_example_tutorial.inc',
+    'weight' => 10,
+  );
   $items['examples/form_example/states'] = array(
     'title' => '#states example',
     'page callback' => 'drupal_get_form',
@@ -141,4 +150,30 @@ function form_example_menu() {
 function form_example_intro() {
   $markup = t('The form example module provides a tutorial, extensible multistep example, and a #states example');
   return array('#markup' => $markup);
-}
\ No newline at end of file
+}
+
+/**
+ * Implements hook_theme().
+ *
+ */
+function form_example_theme() {
+  return array(
+    'form_example_tutorial_10b' => array(
+      'render element' => 'form',
+    ),
+  );
+}
+
+function theme_form_example_tutorial_10b($variables) {
+  $output = '';
+  $form = $variables['form'];
+  // here we wrap the textfield and button in a div
+  // change the size of the textfield
+  // change the title of the textfield
+  $form['name']['#prefix'] = '<div class="container-inline">';
+  $form['name']['#size'] = 20;
+  $form['name']['#title'] = t('Your name');
+  $form['submit']['#suffix'] = '</div>';
+  $output .= drupal_render_children($form);
+  return $output;
+}
Index: form_example/form_example_tutorial.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/examples/form_example/form_example_tutorial.inc,v
retrieving revision 1.8
diff -u -p -r1.8 form_example_tutorial.inc
--- form_example/form_example_tutorial.inc	1 Sep 2010 11:37:55 -0000	1.8
+++ form_example/form_example_tutorial.inc	1 Nov 2010 15:47:31 -0000
@@ -25,6 +25,7 @@
  * @see form_example_tutorial_7()
  * @see form_example_tutorial_8()
  * @see form_example_tutorial_9()
+ * @see form_example_tutorial_10()
  *
  */
 function form_example_tutorial() {
@@ -682,3 +683,78 @@ function form_example_tutorial_9_submit(
   }
   drupal_set_message($output);
 }
+
+//////////////// Tutorial Example 10 //////////////////////
+
+/**
+ * Example 10: A page with multiple forms.
+ *
+ * This example shows how to have one or more forms on a page.
+ * It also demonstrates the use of theming with forms.
+ *
+ *
+ *
+ * @see form_example_tutorial_10()
+ * @see form_example_tutorial_10a()
+ * @see form_example_tutorial_10b()
+ * @ingroup form_example
+ *
+ */
+function form_example_tutorial_10() {
+  $content = "<p>This page demonstrates how to embed one or more forms on a page.</p>";
+  $content .= "<p>Form A is unthemed</p>";
+  $form = drupal_get_form('form_example_tutorial_10a');
+  $content .= render($form);
+  $content .= "<p>Form B is themed</p>";
+  $form = drupal_get_form('form_example_tutorial_10b');
+  $content .= render($form);
+  return $content;
+}
+
+/**
+ * Unthemed form
+ *
+ */
+function form_example_tutorial_10a($form, &$form_state) {
+  $form['description'] = array(
+    '#type' => 'item',
+    '#title' => t('Form A'),
+  );
+
+  $form['name'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Name'),
+  );
+
+  // Adds a simple submit button that refreshes the form and clears its contents -- this is the default behavior for forms.
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => 'Submit',
+  );
+  return $form;
+}
+
+/**
+ * Themed form
+ *
+ * @see form_example_theme()
+ * @see theme_form_example_tutorial_10b()
+ */
+function form_example_tutorial_10b($form, &$form_state) {
+  $form['description'] = array(
+    '#type' => 'item',
+    '#title' => t('Form B'),
+  );
+
+  $form['name'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Name'),
+  );
+
+  // Adds a simple submit button that refreshes the form and clears its contents -- this is the default behavior for forms.
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => 'Submit',
+  );
+  return $form;
+}
