diff --git a/location_gmap_find_address/location_gmap_find_address.js b/location_gmap_find_address/location_gmap_find_address.js
index 9b5bff4..89aa7cd 100644
--- a/location_gmap_find_address/location_gmap_find_address.js
+++ b/location_gmap_find_address/location_gmap_find_address.js
@@ -5,19 +5,19 @@
             $("button.location-gmap-find-address-button").click(function (e) {
                 e.preventDefault();
                 var address_parts = new Array();
-                $("fieldset#edit-" + $(this).val() + " .form-item input[type=text]," +
-                    "fieldset#edit-" + $(this).val() + " .form-item select > option:selected").each(function () {
-                        if (!$(this).hasClass('gmap-control') && $(this).val() != '') {
-                            if ($(this).is('option')) {
-                                address_parts.push($(this).text());
-                            } else {
-                                address_parts.push($(this).val());
-                            }
+                var button = $(this);
+                var field_parent = button.parents('.field-type-location');
+                $(".form-item input[type=text], .form-item select > option:selected", field_parent).each(function () {
+                    if (!$(this).hasClass('gmap-control') && $(this).val() != '') {
+                        if ($(this).is('option')) {
+                            address_parts.push($(this).text());
+                        } else {
+                            address_parts.push($(this).val());
                         }
-                    });
-
+                    }
+                });
                 var address_string = address_parts.join(', ');
-                var gmap_id = $("fieldset#edit-" + $(this).val() + " .gmap-map").attr('id');
+                var gmap_id = $(".gmap-map", field_parent).attr('id');
                 if (google.maps.version !== 'undefined') { // assume Google Maps API v3 as API v2 did not have this variable
                     var geocoder = new google.maps.Geocoder();
                     geocoder.geocode({'address': address_string}, function (results, status) {
@@ -55,5 +55,4 @@
         }
 
     }
-})(jQuery);
-
+})(jQuery);
\ No newline at end of file
