diff --git a/entityreference_prepopulate.module b/entityreference_prepopulate.module
index b6346c6..33e6dd1 100644
--- a/entityreference_prepopulate.module
+++ b/entityreference_prepopulate.module
@@ -57,7 +57,7 @@ function entityreference_prepopulate_field_default_value($entity_type, $entity,
   if (module_exists('og') && og_is_group_audience_field($instance['field_name'])) {
     return entityreference_prepopulate_og_field_default_value($entity_type, $entity, $field, $instance, $langcode);
   }
-  if ($items = entityreference_prepopulate_get_values($field, $instance)) {
+  if ($items = entityreference_prepopulate_get_values($field, $instance, $langcode)) {
     // TODO: Check field cardinality.
     return $items;
   }
@@ -70,7 +70,7 @@ function entityreference_prepopulate_og_field_default_value($entity_type, $entit
   if (empty($instance['field_mode'])) {
     return array();
   }
-  if ($items = entityreference_prepopulate_get_values($field, $instance)) {
+  if ($items = entityreference_prepopulate_get_values($field, $instance, $langcode)) {
     // Filter out the items that don't match the field-mode.
     $gids = array();
     foreach ($items as $item) {
@@ -93,12 +93,6 @@ function entityreference_prepopulate_og_field_default_value($entity_type, $entit
 function entityreference_prepopulate_field_attach_form($entity_type, $entity, &$form, &$form_state, $langcode) {
   list($id,,$bundle) = entity_extract_ids($entity_type, $entity);
 
-  if (!empty($form_state['triggering_element']['#ajax'])) {
-    // We are inside AJAX, so values can't be taken from URL at the
-    // moment.
-    return;
-  }
-
   // Check if there is a field that needs to be prepopulated attached to the
   // given entity.
   $found = FALSE;
@@ -128,7 +122,7 @@ function entityreference_prepopulate_field_attach_form($entity_type, $entity, &$
       }
 
       $field = $value['field'];
-      if (entityreference_prepopulate_get_values($field, $instance) || ($id && !empty($settings['action_on_edit']))) {
+      if (entityreference_prepopulate_get_values($field, $instance, $langcode) || ($id && !empty($settings['action_on_edit']))) {
         // New entity with prepopualte values, or an existing entity,
         // we might need to disable/ hide the group-audience field.
         if ($settings['action'] == 'disable') {
@@ -197,18 +191,20 @@ function entityreference_prepopulate_field_access($op, $field, $entity_type, $en
  *   The field info array.
  * @param $instance
  *   The instance info array.
+ * @param $langcode
+ *   The language code of the field.
  * @param $flat_array.
  *   TRUE if the group IDs should be sent as a simple array. FALSE, if we
  *   need to build array suited for field API's $items value.
  */
-function entityreference_prepopulate_get_values($field, $instance, $flat_array = FALSE) {
+function entityreference_prepopulate_get_values($field, $instance, $langcode = 'und', $flat_array = FALSE) {
   $settings = $instance['settings']['behaviors']['prepopulate'];
 
   if (!empty($settings['og_context']) && module_exists('og_context')) {
     return entityreference_prepopulate_get_values_from_og_context($field, $instance, $flat_array);
   }
 
-  return entityreference_prepopulate_get_values_from_url($field, $instance, $flat_array);
+  return entityreference_prepopulate_get_values_from_url($field, $instance, $langcode, $flat_array);
 }
 
 function entityreference_prepopulate_get_values_from_og_context($field, $instance, $flat_array = FALSE) {
@@ -235,6 +231,8 @@ function entityreference_prepopulate_get_values_from_og_context($field, $instanc
  *   The field info array.
  * @param $instance
  *   The instance info array.
+ * @param $langcode
+ *   The language code of the field.
  * @param $flat_array.
  *   TRUE if the group IDs should be sent as a simple array. FALSE, if we
  *   need to build array suited for field API's $items value.
@@ -242,7 +240,7 @@ function entityreference_prepopulate_get_values_from_og_context($field, $instanc
  * @see
  *   entityreference_prepopulate_get_values()
  */
-function entityreference_prepopulate_get_values_from_url($field, $instance, $flat_array = FALSE) {
+function entityreference_prepopulate_get_values_from_url($field, $instance, $langcode = 'und', $flat_array = FALSE) {
   $cache = &drupal_static(__FUNCTION__, array());
   $field_name = $field['field_name'];
   $identifier = $instance['entity_type'] . ':' . $instance['bundle'] . ':' . $field_name . ':' . $flat_array;
@@ -251,6 +249,17 @@ function entityreference_prepopulate_get_values_from_url($field, $instance, $fla
   }
   $cache[$identifier] = FALSE;
 
+  // When in an AJAX request, get the field values from the form cache
+  if (isset($_POST) && !empty($_POST['form_build_id'])) {
+    $form_state = array();
+    $form = form_get_cache($_POST['form_build_id'], $form_state);
+
+    $default_value = $form[$field_name][$langcode][0]['target_id']['#default_value'];
+    if (!empty($default_value)) {
+      $_GET[$field_name] = (is_array($default_value)) ? implode(',', $default_value) : $default_value;
+    }
+  }
+
   if (empty($_GET[$field_name]) || !is_string($_GET[$field_name])) {
     return;
   }
