Form Submitted

Thank You!

Your submission has been received. Our team will be in contact with you soon.

If you need immediate attention please don’t hesitate to call us direct at (631) 528-2248

function waitForPopupAndInitAutocomplete() { const observer = new MutationObserver(() => { const popup = document.querySelector('.pum-active'); // Adjust selector if needed if (popup) { console.log('✅ Popup opened:', popup); // Try finding the label const labels = Array.from(popup.querySelectorAll('label')); const targetLabel = labels.find(label => label.textContent.trim().toLowerCase().includes('property address') ); if (!targetLabel) { console.warn('❌ Label "Property Address" not found.'); return; } // Find the associated input using `for` attribute or proximity let addressInput = null; const forAttr = targetLabel.getAttribute('for'); if (forAttr) { addressInput = popup.querySelector(`#${forAttr}`); } else { addressInput = targetLabel.closest('div')?.querySelector('input'); } if (addressInput) { console.log('🏷️ Found input for label "Property Address":', addressInput); const autocomplete = new google.maps.places.Autocomplete(addressInput, { types: ['geocode'], componentRestrictions: { country: 'us' } }); console.log('📍 Google Places autocomplete initialized.'); observer.disconnect(); // Stop observing after success } else { console.warn('❌ Could not find associated input for "Property Address".'); } } }); observer.observe(document.body, { childList: true, subtree: true }); } waitForPopupAndInitAutocomplete();