diff --git a/inline_entity_form.module b/inline_entity_form.module
index 393cb26..a5c22d6 100644
--- a/inline_entity_form.module
+++ b/inline_entity_form.module
@@ -195,7 +195,14 @@ function inline_entity_form_field_widget_form(&$form, &$form_state, $field, $ins
   $parents = array_merge($element['#field_parents'], array($element['#field_name'], $element['#language']));
 
   // Assign a unique identifier to each IEF widget.
-  $ief_id = $instance['id'];
+  if (isset($form['#ief_id'])) {
+    $delta = isset($form['#ief_row_delta']) ? $form['#ief_row_delta'] : 0;
+    $ief_id = $form['#ief_id'] . '-' . $delta . '-' . $instance['id'];
+  }
+  else {
+    $ief_id = $instance['id'];
+  }
+
   // Determine the wrapper ID for the entire element.
   $wrapper = 'inline-entity-form-' . $ief_id;
   $element = array(
@@ -277,6 +284,7 @@ function inline_entity_form_field_widget_form(&$form, &$form_state, $field, $ins
       '#entity_type' => $settings['entity_type'],
       // Identifies the IEF widget to which the form belongs.
       '#ief_id' => $ief_id,
+      '#ief_path' => $ief_id . '-0',
     );
     if (!empty($form_state['inline_entity_form'][$ief_id]['entities'])) {
       $element['form']['#op'] = 'edit';
@@ -334,6 +342,7 @@ function inline_entity_form_field_widget_form(&$form, &$form_state, $field, $ins
           '#ief_id' => $ief_id,
           // Identifies the table row to which the form belongs.
           '#ief_row_delta' => $key,
+          '#ief_path' => $ief_id . '-' . $key,
         );
         // Prepare data for the form callbacks.
         $form = &$element['entities'][$key]['form'];
@@ -442,6 +451,7 @@ function inline_entity_form_field_widget_form(&$form, &$form_state, $field, $ins
         '#parents' => array_merge($parents, array('form')),
         // Pass the current entity type.
         '#entity_type' => $settings['entity_type'],
+        '#ief_path' => $ief_id . '-0',
       );
 
       if ($form_state['inline_entity_form'][$ief_id]['form'] == 'add') {
@@ -485,12 +495,7 @@ function inline_entity_form_field_widget_form(&$form, &$form_state, $field, $ins
  */
 function inline_entity_form_entity_form($controller, $entity_form, &$form_state) {
   $labels = $controller->labels();
-  // Build a deta suffix that's appended to button #name keys for uniqueness.
-  $delta = $entity_form['#ief_id'];
-  if ($entity_form['#op'] == 'edit') {
-    $delta .= '-' . $entity_form['#ief_row_delta'];
-  }
-  elseif ($entity_form['#op'] == 'add') {
+  if ($entity_form['#op'] == 'add') {
     // Create a new entity that will be passed to the form.
     $form_settings = $form_state['inline_entity_form'][$entity_form['#ief_id']]['form settings'];
     $entity_form['#entity'] = inline_entity_form_create_entity($entity_form['#entity_type'], $form_settings['bundle']);
@@ -510,7 +515,8 @@ function inline_entity_form_entity_form($controller, $entity_form, &$form_state)
   $entity_form['actions']['ief_' . $entity_form['#op'] . '_save'] = array(
     '#type' => 'submit',
     '#value' => t('Save @type_singular', array('@type_singular' => $labels['singular'])),
-    '#name' => 'ief-' . $entity_form['#op'] . '-submit-' . $delta,
+    '#name' => 'ief-' . $entity_form['#op'] . '-submit-' . $entity_form['#ief_id'],
+    '#ief_id' => $entity_form['#ief_id'],
     '#limit_validation_errors' => array($entity_form['#parents']),
     '#attributes' => array('class' => array('ief-entity-submit')),
     '#ajax' => array(
@@ -521,7 +527,8 @@ function inline_entity_form_entity_form($controller, $entity_form, &$form_state)
   $entity_form['actions']['ief_' . $entity_form['#op'] . '_cancel'] = array(
     '#type' => 'submit',
     '#value' => t('Cancel'),
-    '#name' => 'ief-' . $entity_form['#op'] . '-cancel-' . $delta,
+    '#name' => 'ief-' . $entity_form['#op'] . '-cancel-' . $entity_form['#ief_id'],
+    '#ief_id' => $entity_form['#ief_id'],
     '#limit_validation_errors' => array(),
     '#ajax' => array(
       'callback' => 'inline_entity_form_get_element',
@@ -541,6 +548,8 @@ function inline_entity_form_entity_form($controller, $entity_form, &$form_state)
     $entity_form['actions']['ief_edit_cancel']['#ief_row_delta'] = $entity_form['#ief_row_delta'];
   }
 
+  // Add the validation callback that sets the row weigths
+  $entity_form['#element_validate'][] = 'inline_entity_form_entity_form_save_row_weights';
   // Add the validation callback that calls the controller's
   // entityFormValidate() and entityFormSubmit() methods.
   // Implemented as #element_validate so that entity forms are submitted
@@ -570,13 +579,16 @@ function inline_entity_form_entity_form($controller, $entity_form, &$form_state)
 function inline_entity_form_process_entity_form(&$entity_form, &$form_state) {
   // Only react on submissions triggered by the main submit buttons.
   $triggering_element_name = end($form_state['triggering_element']['#array_parents']);
-  if (empty($form_state['triggering_element']['#ief_submit_all']) && !in_array($triggering_element_name, array('ief_add_save', 'ief_edit_save'))) {
-    return;
+  if (empty($form_state['triggering_element']['#ief_submit_all'])) {
+    if (!in_array($triggering_element_name, array('ief_add_save', 'ief_edit_save')) || ($form_state['triggering_element']['#ief_id'] != $entity_form['#ief_id'])) {
+      return;
+    }
   }
 
   $entity_type = $entity_form['#entity_type'];
   $entity_info = entity_get_info($entity_type);
   $ief_id = $entity_form['#ief_id'];
+
   $type_settings = $form_state['inline_entity_form'][$ief_id]['type_settings'];
 
   // Instantiate the controller and validate the form.
@@ -610,6 +622,148 @@ function inline_entity_form_process_entity_form(&$entity_form, &$form_state) {
   }
 }
 
+ /**
+ * Provides the entity attach form for attaching existing entities
+ *
+ * @param $entity_form
+ *   The form array that will receive the entity form.
+ * @param $form_state
+ *   The form state of the parent form.
+ *
+ * @return
+ *   The form array containing the embedded entity form.
+ */
+function inline_entity_form_attach_entity_form($controller, $entity_form, &$form_state) {
+  $labels = $controller->labels();
+  $bundle = $form_state['inline_entity_form'][$entity_form['#ief_id']]['form settings']['bundle'];
+
+  $entity_form['existing_entity'] = array(
+    '#type' => 'textfield',
+    '#title' => t('@label', array('@label' => ucwords($labels['singular']))),
+    '#description' => t('Enter the @label to be referenced', array('@label' => $labels['singular'])),
+    '#required' => TRUE,
+  );
+
+  // Add the appropriate autocomplete path to the widget.
+  $settings = $form_state['inline_entity_form'][$entity_form['#ief_id']]['settings'];
+  switch ($settings['field_type']) {
+    case 'entityreference':
+      // Get the entity variables of the complete form to create the path for
+      // Entity reference's autocomplete.
+      $parents = $entity_form['#parents'];
+      array_pop($parents);
+      $element = drupal_array_get_nested_value($form_state['complete form'], $parents);
+      list($form_entity_id, ,) = entity_extract_ids($element['#entity_type'], $element['#entity']);
+      $autocomplete_path = 'entityreference/autocomplete/single';
+      $autocomplete_path .= '/' . $element['#field_name'] . '/' . $element['#entity_type'] . '/' . $element['#bundle'] . '/' . $form_entity_id;
+
+      $entity_form['existing_entity']['#autocomplete_path'] = $autocomplete_path;
+      // Entity reference autocomplete requires its validate handler to
+      // convert the values to the correct autocomplete path.
+      $entity_form['existing_entity']['#element_validate'] = array('_entityreference_autocomplete_validate');
+      break;
+    case 'commerce_product_reference':
+      $entity_form['existing_entity']['#autocomplete_path'] = 'commerce_product/autocomplete/commerce_product/commerce_product/' . $bundle;
+      break;
+  }
+   // Add the actions
+  $entity_form['actions'] = array(
+    '#type' => 'container',
+    '#weight' => 100,
+  );
+  $entity_form['actions']['ief_' . $entity_form['#op'] . '_save'] = array(
+    '#type' => 'submit',
+    '#value' => t('Attach @type_singular', array('@type_singular' => $labels['singular'])),
+    '#name' => 'ief-' . $entity_form['#op'] . '-submit-' . $entity_form['#ief_id'],
+    '#limit_validation_errors' => array($entity_form['#parents']),
+    '#attributes' => array('class' => array('ief-entity-submit')),
+    '#ajax' => array(
+      'callback' => 'inline_entity_form_get_element',
+      'wrapper' => 'inline-entity-form-' . $entity_form['#ief_id'],
+    ),
+  );
+  $entity_form['actions']['ief_' . $entity_form['#op'] . '_cancel'] = array(
+    '#type' => 'submit',
+    '#value' => t('Cancel'),
+    '#name' => 'ief-' . $entity_form['#op'] . '-cancel-' . $entity_form['#ief_id'],
+    '#limit_validation_errors' => array(),
+    '#ajax' => array(
+      'callback' => 'inline_entity_form_get_element',
+      'wrapper' => 'inline-entity-form-' . $entity_form['#ief_id'],
+    ),
+  );
+  // Add the appropriate submit handlers and their related data.
+  $entity_form['actions']['ief_' . $entity_form['#op'] . '_save']['#submit'] = array('inline_entity_form_close_form');
+  $entity_form['actions']['ief_' . $entity_form['#op'] . '_cancel']['#submit'] = array('inline_entity_form_close_form');
+  $entity_form['#element_validate'][] = 'inline_entity_form_process_attach_entity_form';
+  return $entity_form;
+}
+
+/**
+ * Processes an entity attach form submission.
+ *
+ * The entity attach form loads the entity using the subitted entity id/sku
+ * If the entity is loaded successfully, existing entities in the IEF array are
+ * compared to prevent duplicates. If all validation passes the entity is
+ * attached to the entities array and the IEF table is updated.
+ *
+ * @param $entity_form
+ *  The form of the entity being managed inline.
+ * @param $form_state
+ *   The form state of the parent form.
+ */
+function inline_entity_form_process_attach_entity_form(&$entity_form, &$form_state) {
+  $ief_id = $entity_form['#ief_id'];
+  $entity_type = $entity_form['#entity_type'];
+  $parents_path = implode('][', $entity_form['#parents']);
+
+  $form_values = drupal_array_get_nested_value($form_state['values'], $entity_form['#parents']);
+  $existing_entity = $form_values['existing_entity'];
+
+  // Instantiate controller to access labels
+  $entity_info = entity_get_info($entity_type);
+  $type_settings = $form_state['inline_entity_form'][$ief_id]['type_settings'];
+  $controller = new $entity_info['inline entity form']['controller']($entity_type, $type_settings);
+  $labels = $controller->labels();
+
+  // The value we get from the autocomplete depends on the field type we're on.
+  $settings = $form_state['inline_entity_form'][$ief_id]['settings'];
+  switch ($settings['field_type']) {
+    case 'entityreference':
+      // $existing_entity is an entity ID.
+      $load_entity = entity_load($entity_form['#entity_type'], array($existing_entity));
+      $attach_entity = $load_entity[$existing_entity];
+      break;
+    case 'commerce_product_reference':
+      // Load commerce_product entity by SKU
+      $attach_entity = commerce_product_load_by_sku($existing_entity);
+      break;
+  }
+
+  // Check to see if entity is already referenced by current IEF widget
+  if (!empty($attach_entity)) {
+    foreach ($form_state['inline_entity_form'][$ief_id]['entities'] as $key => $entity) {
+      if ($entity['entity'] == $attach_entity) {
+        form_set_error($parents_path . '][existing_entity', t('This selected @label has already been referenced', array('@label' => $labels['singular'])));
+        unset($attach_entity);
+      }
+    }
+  }
+  else {
+    form_set_error($parents_path . '][existing_entity', t('This selected @label is not valid.', array('@label' => $labels['singular'])));
+  }
+
+  // If validation passes attach entity to the entities array
+  if (!empty($attach_entity)) {
+    $form_state['inline_entity_form'][$ief_id]['entities'][] = array(
+      'entity' => $attach_entity,
+      'weight' => $key + 1,
+      'form' => NULL,
+      'needs_save' => FALSE,
+    );
+  }
+}
+
 /**
  * Wraps and returns the delete form provided by the passed-in controller.
  *
@@ -787,6 +941,36 @@ function inline_entity_form_save_row_weights($element, &$form_state, $form) {
 }
 
 /**
+ * IEF widget #element_validate callback: Sets the row weights for nested IEFs.
+ */
+function inline_entity_form_entity_form_save_row_weights($entity_form, &$form_state, $form) {
+  $ief_id = $entity_form['#ief_id'];
+  $triggering_element = $form_state['triggering_element'];
+  $triggering_element_name = end($triggering_element['#array_parents']);
+  // Only on edit/add save button for triggering element entity form
+  if (!in_array($triggering_element_name, array('ief_add_save', 'ief_edit_save')) || ($triggering_element['#ief_id'] != $ief_id)) {
+    return;
+  }
+  $entity_type = $entity_form['#entity_type'];
+  $ief_form = drupal_array_get_nested_value($form_state['complete form'], $entity_form['#array_parents']);
+  foreach (field_info_instances($entity_type, $entity_form['#bundle']) as $instance) {
+    if (isset($instance['widget']) && $instance['widget']['type'] == 'inline_entity_form') {
+      $field_name = $instance['field_name'];
+      $ief_id = !isset($ief_form['#ief_path']) ? $instance['id'] : $ief_form['#ief_path'] . '-' . $instance['id'];
+      $langcode = $ief_form[$field_name]['#language'];
+      // There's no IEF data for this field, skip it.
+      if (empty($form_state['inline_entity_form'][$ief_id])) {
+        continue;
+      }
+      $child_ief_form = $ief_form[$field_name][$langcode];
+      foreach (element_children($child_ief_form['entities']) as $key) {
+        $form_state['inline_entity_form'][$ief_id]['entities'][$key]['weight'] = $child_ief_form['entities'][$key]['delta']['#value'];
+      }
+    }
+  }
+}
+
+/**
  * Implements hook_field_attach_submit().
  */
 function inline_entity_form_field_attach_submit($parent_entity_type, $parent_entity, $form, &$form_state) {
@@ -796,7 +980,7 @@ function inline_entity_form_field_attach_submit($parent_entity_type, $parent_ent
     if (isset($instance['widget']) && $instance['widget']['type'] == 'inline_entity_form') {
       $field_name = $instance['field_name'];
       $langcode = $form[$field_name]['#language'];
-      $ief_id = $instance['id'];
+      $ief_id = !isset($form['#ief_path']) ? $instance['id'] : $form['#ief_path'] . '-' . $instance['id'];
       // There's no IEF data for this field, skip it.
       if (empty($form_state['inline_entity_form'][$ief_id])) {
         continue;
