diff --git a/src/client/javascripts/location-map.js b/src/client/javascripts/location-map.js index a454974f1..55239374c 100644 --- a/src/client/javascripts/location-map.js +++ b/src/client/javascripts/location-map.js @@ -112,7 +112,7 @@ export function initMaps(config = {}) { // If there are location components on the page fix up the main form submit // handler so it doesn't fire when using the integrated map search feature if (locations.length) { - const form = document.querySelector('form') + const form = locations[0].closest('form') if (form === null) { return