diff --git a/webform.module b/webform.module
index 3c12f8a..d142178 100644
--- a/webform.module
+++ b/webform.module
@@ -2025,9 +2025,17 @@
       $prev_page_labels = array();
     }
 
+    // Set the input values based on whether we're editing an existing
+    // submission or not.
+    $input_values = isset($submission->data) ? $submission->data : array();
+    if (isset($form_state['values']['submitted'])) {
+      foreach ($form_state['values']['submitted'] as $cid => $data) {
+        $input_values[$cid] = $data;
+      }
+    }
+
     // Recursively add components to the form. The unfiltered version of the
     // form (typically used in Form Builder), includes all components.
-    $input_values = isset($form_state['values']['submitted']) ? $form_state['values']['submitted'] : NULL;
     foreach ($component_tree['children'] as $cid => $component) {
       $component_value = isset($form_state['values']['submitted'][$cid]) ? $form_state['values']['submitted'][$cid] : NULL;
       if ($filter == FALSE || _webform_client_form_rule_check($node, $component, $page_num, $input_values)) {