diff --git ahah_example/README.txt ahah_example/README.txt
new file mode 100644
index 0000000..9065e16
--- /dev/null
+++ ahah_example/README.txt
@@ -0,0 +1,12 @@
+AHAH example provides three simple examples of AHAH in Drupal 6.
+
+There is a tutorial based on this module at http://randyfay.com/ahah.
+
+1. simplest_ahah: A tremendously simple example that just swaps out a div when you click
+   the submit button (simplest_ahah)
+   
+2. autocheckboxes: Regenerate a form with the number of checkboxes determined
+   by a select pulldown.
+   
+3. autotextfields: Regenerate a form with various textfields based on whether
+   a checkbox is clicked.
\ No newline at end of file
diff --git ahah_example/ahah_example.info ahah_example/ahah_example.info
new file mode 100644
index 0000000..8895b93
--- /dev/null
+++ ahah_example/ahah_example.info
@@ -0,0 +1,5 @@
+; $Id: ahah_example.info,v 1.4.2.1 2009/02/04 13:42:50 rfay Exp $
+name = AHAH Example
+description = Demonstrate Drupal AHAH forms
+package = Example modules
+core = 6.x
diff --git ahah_example/ahah_example.module ahah_example/ahah_example.module
new file mode 100644
index 0000000..57bf8b4
--- /dev/null
+++ ahah_example/ahah_example.module
@@ -0,0 +1,64 @@
+<?php
+// $Id: ahah_example.module,v 1.3 2007/10/05 16:11:36 drewish Exp $
+
+/**
+ * @file
+ * Demo of some varieties of AHAH in Drupal 6.
+ * A tutorial based on this module is at http://randyfay.com/ahah.
+ *
+*/
+
+$path = drupal_get_path('module','ahah_example');
+
+/**
+ * Implement hook_menu().
+ */
+function ahah_example_menu() {
+  $items = array();
+
+  // Simple AHAH with its callback.
+  $items['ahah_example/simplest_ahah'] = array(
+    'title' => t('AHAH: Simplest Example'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('ahah_example_simplest'),
+    'access callback' => TRUE,
+    'file' => 'simplest_ahah.inc',
+  );
+  $items['ahah_example/simplest_ahah/callback'] = array(
+    'page callback' => 'ahah_example_simplest_callback',
+    'access callback' => TRUE,
+    'file' => 'simplest_ahah.inc',
+    );
+
+  // Automatically generate checkboxes.
+  $items['ahah_example/autocheckboxes'] = array(
+    'title' => t('AHAH: generate checkboxes'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('ahah_example_autocheckboxes'),
+    'access callback' => TRUE,
+    'file' => 'autocheckboxes.inc',
+  );
+  $items['ahah_example/autocheckboxes/callback'] = array(
+    'type' => MENU_CALLBACK,
+    'page callback' => 'ahah_example_autocheckboxes_callback',
+    'access callback' => TRUE,
+    'file' => 'autocheckboxes.inc',
+    );
+
+    // Automatically generate textfields.
+  $items['ahah_example/autotextfields'] = array(
+    'title' => t('AHAH: generate textfields'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('ahah_example_autotextfields'),
+    'access callback' => TRUE,
+    'file' => 'autotextfields.inc',
+  );
+  $items['ahah_example/autotextfields/callback'] = array(
+    'type' => MENU_CALLBACK,
+    'page callback' => 'ahah_example_autotextfields_callback',
+    'access callback' => TRUE,
+    'file' => 'autotextfields.inc',
+    );
+  return $items;
+}
+
diff --git ahah_example/autocheckboxes.inc ahah_example/autocheckboxes.inc
new file mode 100644
index 0000000..46b3f70
--- /dev/null
+++ ahah_example/autocheckboxes.inc
@@ -0,0 +1,76 @@
+<?php
+
+/**
+ * @file
+ * A Self-configure a form based on a select control.
+ * Add the number of checkboxes specified in the select.
+ */
+function ahah_example_autocheckboxes(&$form_state) {
+
+  $default = !empty($form_state['values']['howmany']) ? $form_state['values']['howmany'] : 1;
+  $form['howmany'] = array(
+    '#title' => t('How many checkboxes do you want?'),
+    '#type' => 'select',
+    '#options' => array(1=>1, 2=>2, 3=>3, 4=>4),
+    '#default_value' => $default,
+    '#ahah' => array(
+      'path' => 'ahah_example/autocheckboxes/callback',
+      'wrapper' => 'checkboxes',
+      'effect' => 'fade',
+    ),
+
+  );
+
+
+  $form['checkboxes'] = array(
+    '#title' => t("Generated Checkboxes"),
+    '#prefix' => '<div id="checkboxes">',
+    '#suffix' => '</div>',
+    '#type' => 'fieldset',
+    '#description' => t('This is where we get automatically generated checkboxes'),
+  );
+
+  $num_checkboxes = !empty($form_state['values']['howmany']) ? $form_state['values']['howmany'] : 1;
+  for ($i=1; $i<=$num_checkboxes; $i++) {
+    $form['checkboxes']["checkbox$i"] = array(
+      '#type' => 'checkbox',
+      '#title' => "Checkbox $i",
+    );
+  }
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Click Me'),
+  );
+
+
+  return $form;
+}
+
+/**
+ * Callback for autocheckboxes. Process the form with the number of checkboxes
+ * we want to provide.
+ */
+function ahah_example_autocheckboxes_callback() {
+  $form_state = array('storage' => NULL, 'submitted' => FALSE);
+  $form_build_id = $_POST['form_build_id'];
+  $form = form_get_cache($form_build_id, $form_state);
+
+  $args = $form['#parameters'];
+  $form_id = array_shift($args);
+  $form_state['post'] = $form['#post'] = $_POST;
+  $form['#programmed'] = $form['#redirect'] = FALSE;
+
+  // HACK: Select values changing never get recognized.
+  unset ($form['howmany']['#value']);
+
+  drupal_process_form($form_id, $form, $form_state);
+  $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id);
+
+  $checkboxes = $form['checkboxes'];
+  $output = drupal_render($checkboxes);
+
+  // Final rendering callback.
+  print drupal_json(array('status' => TRUE, 'data' => $output));
+  exit();
+}
\ No newline at end of file
diff --git ahah_example/autotextfields.inc ahah_example/autotextfields.inc
new file mode 100644
index 0000000..0281521
--- /dev/null
+++ ahah_example/autotextfields.inc
@@ -0,0 +1,85 @@
+<?php
+
+/**
+ * @file
+ * Show/hide textfields based on checkbox clicks.
+ */
+function ahah_example_autotextfields(&$form_state) {
+
+  $default_first_name = !empty($form_state['values']['ask_first_name']) ? $form_state['values']['ask_first_name'] : FALSE;
+  $default_last_name = !empty($form_state['values']['ask_last_name']) ? $form_state['values']['ask_last_name'] : FALSE;
+  $form['ask_first_name'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Ask me my first name'),
+    '#default_value' => $default_first_name,
+    '#ahah' => array(
+      'path' => 'ahah_example/autotextfields/callback',
+      'wrapper' => 'textfields',
+      'effect' => 'fade',
+    )
+  );
+  $form['ask_last_name'] = array(
+   '#type' => 'checkbox',
+   '#title' => t('Ask me my last name'),
+   '#default_value' => $default_last_name,
+
+    '#ahah' => array(
+      'path' => 'ahah_example/autotextfields/callback',
+      'wrapper' => 'textfields',
+      'effect' => 'fade',
+
+    ),
+  );
+
+  $form['textfields'] = array(
+    '#title' => t("Generated text fields for first and last name"),
+    '#prefix' => '<div id="textfields">',
+    '#suffix' => '</div>',
+    '#type' => 'fieldset',
+    '#description' => t('This is where we put automatically generated textfields'),
+  );
+
+   if (!empty($form_state['values']['ask_first_name'])) {
+    $form['textfields']['first_name'] = array(
+      '#type' => 'textfield',
+      '#title' => t('First Name'),
+    );
+  }
+  if (!empty($form_state['values']['ask_last_name'])) {
+    $form['textfields']['last_name'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Last Name'),
+    );
+  }
+
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Click Me'),
+  );
+
+
+  return $form;
+}
+
+
+function ahah_example_autotextfields_callback() {
+  $form_state = array('storage' => NULL, 'submitted' => FALSE);
+  $form_build_id = $_POST['form_build_id'];
+  $form = form_get_cache($form_build_id, $form_state);
+
+  $args = $form['#parameters'];
+  $form_id = array_shift($args);
+  $form_state['post'] = $form['#post'] = $_POST;
+  $form['#programmed'] = $form['#redirect'] = FALSE;
+
+  drupal_process_form($form_id, $form, $form_state);
+  $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id);
+
+  $textfields = $form['textfields'];
+  $output = drupal_render($textfields);
+
+  // Final rendering callback.
+  print drupal_json(array('status' => TRUE, 'data' => $output));
+  exit();
+}
\ No newline at end of file
diff --git ahah_example/simplest_ahah.inc ahah_example/simplest_ahah.inc
new file mode 100644
index 0000000..fc42333
--- /dev/null
+++ ahah_example/simplest_ahah.inc
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * @file
+ * A Hello-world AHAH. Just swaps out a markup section on submit.
+ */
+function ahah_example_simplest() {
+
+  $initial_markup = '<div style="width: 150px; height: 150px; border: 1px solid black">' . t('This box will be replaced') . '</div>';
+
+  $form['box'] = array(
+    '#type' => 'markup',
+    '#prefix' => '<div id="box">',
+    '#suffix' => '</div>',
+    '#value' => $initial_markup,
+  );
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#ahah' => array(
+      'path' => 'ahah_example/simplest_ahah/callback',
+      'wrapper' => 'box',
+    ),
+    '#value' => t('Click Me to change box color'),
+  );
+
+  return $form;
+}
+
+function ahah_example_simplest_callback() {
+  $colors = preg_split('/[ ,]+/', "aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, yellow");
+  $color = $colors[array_rand($colors)];
+  $output = '<div id="box" style="background-color:' . $color .
+    '; width: 150px; height: 150px; border: 1px solid black;">This is ' . $color . ' box</div>';
+  print drupal_json(array('status' => TRUE, 'data' => $output));
+  exit();
+}
\ No newline at end of file
