diff --git a/help/api-forms.html b/help/api-forms.html
index 749c565..c7da860 100644
--- a/help/api-forms.html
+++ b/help/api-forms.html
@@ -11,19 +11,31 @@ The views handler can also implement views_form_validate() and views_form_submit
     return '&lt;!--form-item-' . $this-&gt;options['id'] . '--' . $this-&gt;view-&gt;row_index . '--&gt;';
   }
 
+  function form_element_name() {
+    // Make sure this value is unique for all the view fields
+    return $this-&gt;options['id'];
+  }
+
+  function form_element_row_id($row_id) {
+    // You could use values from $this-&gt;view-&gt;result[$row_id]
+    // to provide complex row ids.
+    return $row_id;
+  }
+
   function views_form(&$form, &$form_state) {
     // The view is empty, abort.
     if (empty($this-&gt;view-&gt;result)) {
       return;
     }
 
-    $field_name = $this-&gt;options['id'];
+    $field_name = $this-&gt;form_element_name();
     $form[$field_name] = array(
       '#tree' => TRUE,
     );
     // At this point, the query has already been run, so we can access the results
     foreach ($this-&gt;view-&gt;result as $row_id => $row) {
-      $form[$field_name][$row_id] = array(
+      $form_element_row_id = $form_element_row_id($row_id);
+      $form[$field_name][$form_element_row_id] = array(
         '#type' => 'textfield',
         '#title' => t('Your name'),
         '#default_value' => '',
@@ -33,7 +45,7 @@ The views handler can also implement views_form_validate() and views_form_submit
 
   // Optional validate function.
   function views_form_validate($form, &$form_state) {
-    $field_name = $this-&gt;options['id'];
+    $field_name = $this->form_element_name();
     foreach ($form_state['values'][$field_name] as $row_id => $value) {
       if ($value == 'Drupal') {
         form_set_error($field_name . '][' . $row_id, "You can't be named Drupal. That's my name.");
diff --git a/views.module b/views.module
index 8085953..1bc8088 100644
--- a/views.module
+++ b/views.module
@@ -1741,6 +1741,15 @@ function views_form_views_form($form, &$form_state, $view, $output) {
 
   $substitutions = array();
   foreach ($view->field as $field_name => $field) {
+    $form_element_name = $field_name;
+    if (method_exists($field, 'form_element_name')) {
+      $form_element_name = $field->form_element_name();
+    }
+    $method_form_element_row_id_exists = FALSE;
+    if (method_exists($field, 'form_element_row_id')) {
+      $method_form_element_row_id_exists = TRUE;
+    }
+
     // If the field provides a views form, allow it to modify the $form array.
     $has_form = FALSE;
     if (property_exists($field, 'views_form_callback')) {
@@ -1756,10 +1765,17 @@ function views_form_views_form($form, &$form_state, $view, $output) {
     // Build the substitutions array for use in the theme function.
     if ($has_form) {
       foreach ($view->result as $row_id => $row) {
+        if ($method_form_element_row_id_exists) {
+          $form_element_row_id = $field->form_element_row_id($row_id);
+        }
+        else {
+          $form_element_row_id = $row_id;
+        }
+
         $substitutions[] = array(
-          'placeholder' => '<!--form-item-' . $field_name . '--' . $row_id . '-->',
-          'field_name' => $field_name,
-          'row_id' => $row_id,
+          'placeholder' => '<!--form-item-' . $form_element_name . '--' . $form_element_row_id . '-->',
+          'field_name' => $form_element_name,
+          'row_id' => $form_element_row_id,
         );
       }
     }
