--- webform/components/select.inc	2009-03-04 00:05:11.000000000 -0500
+++ webform/components/select.inc	2009-08-18 13:09:53.000000000 -0400
@@ -22,6 +22,7 @@
       'items' => '',
       'email' => 0,
       'multiple' => NULL,
+      'select_or_other' => NULL,
       'aslist' => NULL,
       'description' => '',
     ),
@@ -66,6 +67,13 @@
     '#default_value' => $currfield['extra']['multiple'],
     '#description' => t('Check this option if the user should be allowed to choose multiple values.'),
   );
+  $edit_fields['extra']['select_or_other'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Allow Other option'),
+    '#return_value' => 'Y',
+    '#default_value' => $currfield['extra']['select_or_other'],
+    '#description' => t('Check this option if you want to allow users to enter an option not on the list.'),
+  );
   $edit_fields['extra']['aslist'] = array(
     '#type' => 'checkbox',
     '#title' => t('Listbox'),
@@ -171,26 +179,44 @@
       $form_item['#default_value'] = $default_value;
     }
   }
+  elseif ($component['extra']['multiple'] === 'Y') {
+    $form_item['#default_value'] = array();
+  }
 
-  if ($component['extra']['aslist'] === 'Y') {
+  if ($component['extra']['select_or_other'] === 'Y') {
     // Set display as a select list:
-    $form_item['#type'] = 'select';
+    $form_item['#type'] = 'select_or_other';
+    $form_item['#other'] = t('Other (specify)');
+    $form_item['#other_unknown_defaults'] = 'other';
+    $form_item['#other_delimiter'] = ', ';
     if ($component['extra']['multiple'] === 'Y') {
       $form_item['#multiple'] = TRUE;
+      $form_item['#select_type'] = 'checkboxes';
+    } else {
+      $form_item['#multiple'] = FALSE;
+      $form_item['#select_type'] = 'radios';
+    }
+    if ($component['extra']['aslist'] === 'Y') {
+      $form_item['#select_type'] = 'select';
     }
   }
-  else {
+  elseif ($component['extra']['aslist'] === 'Y') {
+    // Set display as a select list:
+    $form_item['#type'] = 'select';
     if ($component['extra']['multiple'] === 'Y') {
-      // Set display as a checkbox set.
-      $form_item['#type'] = 'checkboxes';
-      // Drupal 6 hack to properly render on multipage forms.
-      $form_item['#process'] = array('webform_expand_checkboxes');
-    }
-    else {
-      // Set display as a radio set.
-      $form_item['#type'] = 'radios';
+      $form_item['#multiple'] = TRUE;
     }
   }
+  elseif ($component['extra']['multiple'] === 'Y') {
+    // Set display as a checkbox set.
+    $form_item['#type'] = 'checkboxes';
+    // Drupal 6 hack to properly render on multipage forms.
+    $form_item['#process'] = array('webform_expand_checkboxes');
+  }
+  else {
+    // Set display as a radio set.
+    $form_item['#type'] = 'radios';
+  }
   return $form_item;
 }
 
@@ -270,10 +296,6 @@
       if ($value != '') {
         $data[$key] = $options[$key];
       }
-      // Checkboxes submit a value of 0 when not checked.
-      elseif ($value == 0 && $component['extra']['aslist'] !== 'Y' && $component['extra']['multiple'] === 'Y') {
-        unset($data[$key]);
-      }
       else {
         unset($data[$key]);
       }
