diff --git a/webform_conditional.module b/webform_conditional.module
index ef26b90..16ac5e8 100755
--- a/webform_conditional.module
+++ b/webform_conditional.module
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * This module adds the ability to have hidden conditional fields on Webforms.  It requires the Webform module version 3.x
@@ -7,11 +8,13 @@
  *
  * @author Ted Bowman <ted@tedbow.com>
  */
+ 
 /**
  * Implements hook_form_FORM_ID_alter().
  * @param array $form
  * @param arrray $form_state
  */
+ 
 function webform_conditional_form_webform_component_edit_form_alter(&$form, &$form_state) {
   //not all types are hideable by this module
   if (_webform_conditional_type_is_hideable($form['type']['#value'])) {
@@ -30,7 +33,7 @@ function webform_conditional_form_webform_component_edit_form_alter(&$form, &$fo
           if ($row = db_fetch_array($result)) {
             //not dealing with a new component
             $extra = unserialize($row['extra']);
-            $default_value =  trim(isset($extra['webform_conditional_field_value']) ? $extra['webform_conditional_field_value'] : '');
+            $default_value = trim(isset($extra['webform_conditional_field_value']) ? $extra['webform_conditional_field_value'] : '');
             //don't check for empty b/c 0 could only value
             if ($default_value !== '') {
               //has existing value from this module
@@ -44,14 +47,16 @@ function webform_conditional_form_webform_component_edit_form_alter(&$form, &$fo
     }
   }
 }
+
 /**
  * If you a same page component was selected change how it is stored
  * @param $form
  * @param $form_state
  */
+ 
 function webform_condtional_component_edit_submit($form, &$form_state) {
   $triggerComponents = _webform_conditional_possible_trigger_components($form['nid']['#value'], $form['cid']['#value'], FALSE);
-  $values = trim( $form_state['values']['extra']['conditional_values']);
+  $values = trim($form_state['values']['extra']['conditional_values']);
   if (array_key_exists($form_state['values']['extra']['conditional_component'], $triggerComponents)) {
     //handle with this module'
     //don't check for empty b/c 0 could only value
@@ -66,12 +71,14 @@ function webform_condtional_component_edit_submit($form, &$form_state) {
     $form_state['values']['extra']['conditional_values'] = '';
   }
 }
+
 /*
  * Implements hook_form_alter().
 * Edit Webform
 * Add Javascript to describe dependent fields
 * Add validation of hidden conditional fields
 */
+
 function webform_conditional_form_alter(&$form, $form_state, $form_id) {
   //todo: change to look only at beginning of string
   static $called_forms = array();
@@ -91,7 +98,7 @@ function webform_conditional_form_alter(&$form, $form_state, $form_id) {
     while ($row = db_fetch_array($result)) {
       $rows[$row['cid']] = $row;
     }
-    foreach ( $rows as $row) {
+    foreach ($rows as $row) {
       //see if field is on this page
       $extra = NULL;
       if ($field = _webform_conditional_get_field($form['submitted'], $row['cid']) && !isset($js_fields[$row['form_key']])) {
@@ -139,26 +146,30 @@ function webform_conditional_form_alter(&$form, $form_state, $form_id) {
       'showSpeed' => NULL, //'fast',
     );
     //store JavaScript variable for the webform_conditional_add_js function
-    $form['#webform_conditional_js'] =    $js_settings;
+    $form['#webform_conditional_js'] = $js_settings;
 
   }
 }
+
 /**
  * This function is attached to all conditonal elements that are also required
  * This resets the #required setting which is removed if a element is hidden
  * @param $form_element
  * @return boolean
  */
+ 
 function webform_elment_pre_render_add_required($form_element) {
   $form_element['#required'] = TRUE;
   return $form_element;
 }
+
 /**
  * Determine whether a component is conditional(via this module) by direct trigger or b/c inside a conditional fieldset
  * @param array $component Component array
  * @param int $nid Node that component belongs to
  * @return boolean
  */
+ 
 function _webform_condtional_component_is_conditional($component, $nid) {
   static $form_components;
   if (empty($form_components[$nid])) {
@@ -175,16 +186,19 @@ function _webform_condtional_component_is_conditional($component, $nid) {
   //this element is conditional if its fieldset is conditional
   return _webform_condtional_component_is_conditional($form_components[$nid][$component['pid']], $nid);
 }
+
 /**
  * Change textarea string input to array of lines
  * @param string $textarea_value
  * @return array
  */
+ 
 function _webform_conditional_convert_textarea_lines_to_array($textarea_value) {
   $textarea_value = str_replace("\r\n", "\n", $textarea_value);
   $textarea_value = str_replace("\r", "\n", $textarea_value);
   return explode("\n", $textarea_value);
 }
+
 /**
  * When the form is being built AFTER it is submitted then this function will make components that were hidden not required
  * @param $form_element
@@ -192,6 +206,7 @@ function _webform_conditional_convert_textarea_lines_to_array($textarea_value) {
  *
  * @return boolean
  */
+ 
 function webform_conditional_element_after_build($form_element, &$form_state) {
   //only do this when the form is being submitted NOT displayed
   if (!empty($form_element['#post'])) {
@@ -200,13 +215,28 @@ function webform_conditional_element_after_build($form_element, &$form_state) {
     $components = _webform_conditional_get_all_components($form_element['#webform_component']['nid'], $submitted_values);
     $was_hidden = _webform_conditional_was_hidden($form_element['#webform_component']['cid'], $components);
     if ($was_hidden) {
+	  //deal with webform_grid types
+      if (isset($form_element['#type']) && $form_element['#type'] == 'webform_grid') {
+        foreach ($form_element as &$element) {
+          //one level of depth is enough, as webform_grid won't go further
+          if (is_array($element) && isset($element['#required'])) {
+            $element['#required'] = FALSE;
+          }
+        }
+      }
+      //deal with select_or_other types
+      if (isset($form_element['#select_type'])) {
+        $form_element['#type'] = 'select_or_other';
+        $form_element['select']['#required'] = FALSE;
+        $form_element['other']['#required'] = FALSE;
+      }
       $form_element['#required'] = FALSE;
       _webform_condtional_clear_element_values($form_element, $form_state);
     }
   }
   return $form_element;
-
 }
+
 /**
  * This any component this return the CSS id that Webform creates for the div element that wraps a component
  * This will id will be used on the client side to show/hide components
@@ -219,16 +249,18 @@ function webform_conditional_element_after_build($form_element, &$form_state) {
  * @return string
  *  css id
  */
+ 
 function _webform_conditional_get_css_id($nid, $cid) {
   $components = _webform_conditional_get_all_components($nid);
   $css_id = str_replace("_", "-", $components[$cid]['form_key']);
-  $parent_cid  = $components[$cid]['pid'];
+  $parent_cid = $components[$cid]['pid'];
   while ($parent_cid) {
     $css_id = str_replace("_", "-", $components[$parent_cid]['form_key']) . "--" . $css_id;
     $parent_cid = $components[$parent_cid]['pid'];
   }
   return "webform-component-$css_id";
 }
+
 /**
  * Function run #after_build on webform.  This ensures that Javascript is added even if form is built from cache.
  * @param array $form
@@ -236,11 +268,13 @@ function _webform_conditional_get_css_id($nid, $cid) {
  * @return array
  *  The form
  */
+ 
 function webform_conditional_add_js(&$form, $form_state) {
   drupal_add_js(array('webform_conditional' => $form['#webform_conditional_js']), "setting");
   drupal_add_js(drupal_get_path('module', 'webform_conditional') . '/webform_conditional.js');
   return $form;
 }
+
 /**
  * Get the values submited values from the form_state
  * @param  $form_state
@@ -248,6 +282,7 @@ function webform_conditional_add_js(&$form, $form_state) {
  * @return
  *  Array of submitted values
  */
+ 
 function _webform_conditional_get_submitted_values($form_state) {
   //get component tree
   if (isset($form_state['storage'])) {
@@ -269,8 +304,10 @@ function _webform_conditional_get_submitted_values($form_state) {
  * Clear the submitted values for an element
  * @param $element
  */
+ 
 function _webform_condtional_clear_element_values(&$element, &$form_state) {
-  if (!isset($element['#type']) || $element['#type'] == 'markup') {
+  //select_type deals with values from the select_or_other module
+  if (!isset($element['#select_type']) && (!isset($element['#type']) || $element['#type'] == 'markup')) {
     //markup fields don't have user input to clear
     //markup is default
     return;
@@ -284,7 +321,7 @@ function _webform_condtional_clear_element_values(&$element, &$form_state) {
   else {
     $element['#value'] = '';
   }
-  //handle special cases for certian types
+  //handle special cases types
   // @todo is possible to just search thru all sub-array just clear value properties - instead of specific logic for fields like "date"
   switch ($element['#type']) {
     case 'date':
@@ -292,8 +329,34 @@ function _webform_condtional_clear_element_values(&$element, &$form_state) {
       $element['day']['#value'] = '';
       $element['year']['#value'] = '';
       break;
+      case 'webform_grid':
+        foreach ($element as &$elem) {
+          //one level of depth is enough, as webform_grid won't go further
+          if (is_array($elem) && array_key_exists('#value', $elem)) {
+            $elem['#value'] = '';
+          }
+        }
+        break;
+      case 'select_or_other':
+        if (is_array($element['select']['#value'])) {
+          foreach ($element['select']['#value'] as $key => $value) {
+            $element['select']['#value'][$key] = '';
+          }
+        }
+        else {
+          $element['select']['#value'] = '';
+        }
+        if (is_array($element['other']['#value'])) {
+          foreach ($element['other']['#value'] as $key => $value) {
+            $element['other']['#value'][$key] = '';
+          }
+        }
+        else {
+          $element['other']['#value'] = '';
+        }
+        break;
       //@todo Add other comoponet types that need special clearing logic
-  }
+    }
   // also must clear value in $form_state['values'] so it is not seen by other functions
   $reference_element = FALSE;
   $reference_set = FALSE;
@@ -323,12 +386,14 @@ function _webform_condtional_clear_element_values(&$element, &$form_state) {
     }
   }
 }
+
 /**
  * Return components of current page only
  * @param array $children Nested Component Tree
  * @param int $page_num Current page
  * @return array components of current page only
  */
+ 
 function _webform_conditional_get_page_tree($children, $page_num) {
   $page_tree = array();
   foreach ($children as $cid => $child) {
@@ -338,12 +403,14 @@ function _webform_conditional_get_page_tree($children, $page_num) {
   }
   return $page_tree;
 }
+
 /**
  * Convert the nested submit array to a flattened array
  * @param array $children Nested component tree
  * @param array $submitted Nested submitted values
  * @return array flattened submit array
  */
+ 
 function _webform_conditional_get_submitted_array($children, $submitted) {
   if (empty($children)) {
     return array();
@@ -361,6 +428,7 @@ function _webform_conditional_get_submitted_array($children, $submitted) {
   }
   return $submitted_data;
 }
+
 /**
  * Implements hook_webform_submission_presave().
  *
@@ -368,6 +436,7 @@ function _webform_conditional_get_submitted_array($children, $submitted) {
  * @param object $node
  * @param object $submission
  */
+ 
 function webform_conditional_webform_submission_presave($node, &$submission) {
   $components = _webform_conditional_get_all_components($submission->nid, $submission->data);
   $cleared_data = array();
@@ -378,6 +447,7 @@ function webform_conditional_webform_submission_presave($node, &$submission) {
   }
   $submission->data = $cleared_data;
 }
+
 /**
  * Determine if component should have been hidden on form
  * A component can be hidden 1 of 3 ways
@@ -388,6 +458,7 @@ function webform_conditional_webform_submission_presave($node, &$submission) {
  * @param array $components
  * @return boolean TRUE if element should have been hidden
  */
+ 
 function _webform_conditional_was_hidden($cid, $components) {
   $fieldset_hidden = FALSE;
   $trigger_hidden = FALSE;
@@ -413,7 +484,7 @@ function _webform_conditional_was_hidden($cid, $components) {
     else {
       $matched = in_array($trigger_field['value'], $show_values);
     }
-    $this_hidden = (!$matched &&  $components[$cid]['extra']['webform_conditional_operator'] == "=") || ($matched &&  $components[$cid]['extra']['webform_conditional_operator'] == "!=");
+    $this_hidden = (!$matched &&  $components[$cid]['extra']['webform_conditional_operator'] == "=") || ($matched && $components[$cid]['extra']['webform_conditional_operator'] == "!=");
     if (!$this_hidden) {
       //trigger matched - check if trigger should be shown
       if (!empty($trigger_field['extra']['webform_conditional_cid'])) {
@@ -422,21 +493,24 @@ function _webform_conditional_was_hidden($cid, $components) {
     }
   }
   //wasn't hidden conditional - still could have been belonged to a hidden fieldset
-  if (!empty( $components[$cid]['pid'])) {
+  if (!empty($components[$cid]['pid'])) {
     //this belongs to a fieldset check if it was hidden
     $fieldset_hidden = _webform_conditional_was_hidden($components[$cid]['pid'], $components);
   }
   //can be hidden 1 of 3 ways
   return $this_hidden || $trigger_hidden || $fieldset_hidden;
 }
+
 /**
  * @return The types of elements that should be used as a conditional trigger.
  */
+ 
 function webform_conditional_trigger_types() {
   $types = array('select');
   drupal_alter('webform_conditional_trigger_types', $types);
   return $types;
 }
+
 /**
  * select all the components this component could be dependent on
  * for now this is limited to single select
@@ -445,6 +519,7 @@ function webform_conditional_trigger_types() {
  * @param boolean $return_groups
  * @return array:
  */
+ 
 function _webform_conditional_possible_trigger_components($nid, $cid, $return_groups = TRUE) {
   $new_component = empty($cid);
 
@@ -485,7 +560,6 @@ function _webform_conditional_possible_trigger_components($nid, $cid, $return_gr
           }
         }
         $rows[] = $row;
-
       }
     }
     else {
@@ -513,9 +587,7 @@ function _webform_conditional_possible_trigger_components($nid, $cid, $return_gr
           else {
             $components[$currPage][$row['cid']] = $row['name'];
           }
-
         }
-
       }
     }
   }
@@ -527,6 +599,7 @@ function _webform_conditional_possible_trigger_components($nid, $cid, $return_gr
     return array();
   }
 }
+
 /**
  * Gets all child components under $fieldset_component that can be used as triggers for the component - $current_cid
  * @param array $components
@@ -536,6 +609,7 @@ function _webform_conditional_possible_trigger_components($nid, $cid, $return_gr
  * @param string $label
  * @param boolean $return_groups
  */
+ 
 function _webform_condtional_get_usable_child_elements(&$components, $fieldset_component, $form_components, $current_cid, $label, $return_groups = FALSE) {
   if ($current_cid == $fieldset_component['cid']) {
     return NULL;
@@ -565,6 +639,7 @@ function _webform_condtional_get_usable_child_elements(&$components, $fieldset_c
     }
   }
 }
+
 /**
  * Get the top level fieldset that this component belongs too or itself if not inside a fieldset.
  * @param $nid
@@ -573,6 +648,7 @@ function _webform_condtional_get_usable_child_elements(&$components, $fieldset_c
  * @return
  *  Component as an array.
  */
+ 
 function _webform_conditional_get_base_component($nid, $cid) {
   $components = _webform_conditional_get_all_components($nid);
   $component = $components[$cid];
@@ -581,6 +657,7 @@ function _webform_conditional_get_base_component($nid, $cid) {
   }
   return $component;
 }
+
 /**
  * Get all the Webform Components for a node
  * If submitted_data given add to each component
@@ -588,6 +665,7 @@ function _webform_conditional_get_base_component($nid, $cid) {
  * @param array $submitted_data
  * @return array
  */
+ 
 function _webform_conditional_get_all_components($nid, $submitted_data = array()) {
   $sql = "SELECT * FROM {webform_component} where nid = %d";
   $result = db_query($sql, $nid);
@@ -604,12 +682,14 @@ function _webform_conditional_get_all_components($nid, $submitted_data = array()
   }
   return $components;
 }
+
 /**
  * Determine if component type is hideable
  * Pagebreak and hidden types are not hideable
  * @param string $type
  * @return boolean
  */
+ 
 function _webform_conditional_type_is_hideable($type) {
   $notHideAble = array('pagebreak', 'hidden');
   return !in_array($type, $notHideAble);
@@ -621,6 +701,7 @@ function _webform_conditional_type_is_hideable($type) {
  * @param int $cid
  * @return array|NULL
  */
+ 
 function &_webform_conditional_get_field(&$fields, $cid) {
   foreach ($fields as $key => &$field) {
     if (is_array($fields[$key]) && isset($fields[$key]['#webform_component']) && $fields[$key]['#webform_component']['cid'] == $cid) {
@@ -637,18 +718,21 @@ function &_webform_conditional_get_field(&$fields, $cid) {
   $null = NULL;
   return $null;
 }
+
 /**
  * Implements hook_webform_submission_render_alter().
  * Remove elements that would not have been show according to the Hidden Conditional Rules
  * *** This will look at the current rules for this Webform.  If the rules were changed after this submission they will not hide the field that were hidden at the time of submission
  * @param array $submission Webform submission to be rendered
  */
+ 
 function webform_conditional_webform_submission_render_alter(&$submission) {
   //load the components into a flattened array
   $components = _webform_conditional_get_all_components($submission['#node']->nid, $submission['#submission']->data);
   $form_fields = element_children($submission);
   _webform_conditional_hide_submission_elements($submission, $components);
 }
+
 /**
  * unset submission children
  * @param array $submission_children
@@ -668,4 +752,4 @@ function _webform_conditional_hide_submission_elements(&$submission_children, $c
       }
     }
   }
-}
+}
\ No newline at end of file
